broker = pool.get(user);
collection = broker.openCollection(collectionName, Lock.READ_LOCK);
if (collection == null)
{throw new EXistException("collection " + collectionName
+ " not found");}
final Occurrences occurrences[] = broker.getElementIndex().scanIndexedElements(collection,
inclusive);
final IndexedElement[] result = new IndexedElement[occurrences.length];
for (int i = 0; i < occurrences.length; i++) {
final QName qname = (QName)occurrences[i].getTerm();
result[i] = new IndexedElement(qname.getLocalName(),qname.getNamespaceURI(),