LOG.debug("found " + result.getLength() + " attributes");
	protected NodeSet getAttributes(DocumentSet documents, NodeSet context) {		NodeSet result;		switch (test.getType()) {			case NodeTest.TYPE_TEST :				result = new VirtualNodeSet(axis, (TypeTest) test, context);				((VirtualNodeSet)result).setInPredicate(inPredicate);				break;			case NodeTest.NAME_TEST :				if (buf == null) {					DBBroker broker = null;					try {						broker = pool.get();						buf = (NodeSet) broker.getAttributesByName(documents, test.getName());					} catch (EXistException e) {						LOG.debug("exception while retrieving elements", e);					} finally {						pool.release(broker);					}				}				result = ((ArraySet) buf).getChildren(context, ArraySet.DESCENDANT, inPredicate);				break;			default :				Node n;				Node attr;				NamedNodeMap map;				result = new ArraySet(context.getLength());				for (int i = 0; i < context.getLength(); i++) {					n = context.item(i);					if (n.getNodeType() == Node.ELEMENT_NODE) {						map = ((Element) n).getAttributes();						for (int j = 0; j < map.getLength(); j++) {							attr = map.item(j);							result.add(attr);						}					}				}		}		return result;	}