Sequence result = expr.eval(context, ndocs, contextSet, null);
Sequence result = expr.eval(ndocs, contextSet, null);
	protected Sequence doQuery(		User user,		DBBroker broker,		String xpath,		DocumentSet docs,		NodeSet contextSet,		Hashtable namespaces)		throws Exception {		if(docs == null)			docs = broker.getAllDocuments();		StaticContext context = new StaticContext(broker);		if (namespaces != null) {			Map.Entry entry;			for (Iterator i = namespaces.entrySet().iterator(); i.hasNext();) {				entry = (Map.Entry) i.next();				context.declareNamespace(					(String) entry.getKey(),					(String) entry.getValue());			}		}		LOG.debug("query = " + xpath);		XPathLexer2 lexer = new XPathLexer2(new StringReader(xpath));		XPathParser2 parser = new XPathParser2(lexer, false);		XPathTreeParser2 treeParser = new XPathTreeParser2(context);		parser.xpath();		if (parser.foundErrors()) {			throw new EXistException(parser.getErrorMessage());		}		AST ast = parser.getAST();		LOG.debug("generated AST: " + ast.toStringTree());		PathExpr expr = new PathExpr();		treeParser.xpath(ast, expr);		if (treeParser.foundErrors()) {			throw new EXistException(treeParser.getErrorMessage());		}		LOG.info("query: " + xpath);		long start = System.currentTimeMillis();		DocumentSet ndocs =			(docs == null				? expr.preselect(context)				: expr.preselect(docs, context));		LOG.info(			"pre-select took " + (System.currentTimeMillis() - start) + "ms.");		Sequence result = expr.eval(context, ndocs, contextSet, null);		LOG.info("query took " + (System.currentTimeMillis() - start) + "ms.");		return result;	}