DBBroker broker = null; DocumentSet docs = null; try { broker = brokerPool.get(user); docs = collection.collection.allDocs(broker, new DocumentSet(), true); } catch (EXistException e) { throw new XMLDBException( ErrorCodes.UNKNOWN_ERROR, "error while loading documents: " + e.getMessage(), e); } finally { brokerPool.release(broker); } expression.reset(); XQueryContext context = ((PathExpr)expression).getContext(); context.setBackwardsCompatibility(xpathCompatible); context.setStaticallyKnownDocuments(docs);  Map.Entry entry;  for (Iterator i = namespaceDecls.entrySet().iterator(); i.hasNext();) { entry = (Map.Entry) i.next(); context.declareNamespace((String) entry.getKey(), (String) entry.getValue()); }  for (Iterator i = variableDecls.entrySet().iterator(); i.hasNext();) { entry = (Map.Entry) i.next(); try { context.declareVariable((String) entry.getKey(), entry.getValue()); } catch (XPathException e) { throw new XMLDBException(ErrorCodes.VENDOR_ERROR, e.getMessage(), e); } } return doQuery(expression, docs, null, null);
return execute(null, null, expression, null);
	public ResourceSet execute(CompiledExpression expression) throws XMLDBException {		DBBroker broker = null;		DocumentSet docs = null;		try {			broker = brokerPool.get(user);			docs = collection.collection.allDocs(broker, new DocumentSet(), true);		} catch (EXistException e) {			throw new XMLDBException(				ErrorCodes.UNKNOWN_ERROR,				"error while loading documents: " + e.getMessage(),				e);		} finally {			brokerPool.release(broker);		}		expression.reset();		XQueryContext context = ((PathExpr)expression).getContext();		context.setBackwardsCompatibility(xpathCompatible);		context.setStaticallyKnownDocuments(docs);				Map.Entry entry;		// declare namespace/prefix mappings		for (Iterator i = namespaceDecls.entrySet().iterator(); i.hasNext();) {			entry = (Map.Entry) i.next();			context.declareNamespace((String) entry.getKey(), (String) entry.getValue());		}		// declare static variables		for (Iterator i = variableDecls.entrySet().iterator(); i.hasNext();) {			entry = (Map.Entry) i.next();			try {				context.declareVariable((String) entry.getKey(), entry.getValue());			} catch (XPathException e) {				throw new XMLDBException(ErrorCodes.VENDOR_ERROR, e.getMessage(), e);			}		}		return doQuery(expression, docs, null, null);	}