Hashtable namespaces = (Hashtable)parameters.get(RpcAPI.NAMESPACES); if(namespaces != null && namespaces.size() > 0) { context.declareNamespaces(namespaces); }  context.setBroker(broker);
	protected Sequence doQuery(User user, DBBroker broker, String xpath,			DocumentSet docs, NodeSet contextSet, Hashtable parameters)			throws Exception {		String baseURI = (String) parameters.get(RpcAPI.BASE_URI);		if(docs == null) {			if(baseURI == null)				docs = broker.getAllDocuments(new DocumentSet());			else {				docs = new DocumentSet();				Collection root = broker.getCollection(baseURI);				root.allDocs(broker, docs, true);			}		}		CachedQuery cached = getCachedQuery(xpath);		PathExpr expr = null;		if (cached == null) {			expr = compile(user, broker, xpath, parameters);			cached = new CachedQuery(expr, xpath);			cachedExpressions.add(cached);		} else {			LOG.debug("reusing compiled expression");			expr = cached.expression;		}		XQueryContext context = expr.getContext();		context.setBaseURI(baseURI);		context.setStaticallyKnownDocuments(docs);				long start = System.currentTimeMillis();		Sequence result = expr.eval(contextSet, null);		LOG.info("query took " + (System.currentTimeMillis() - start) + "ms.");		expr.reset();		return result;	}