Sequence resultSeq = expr.eval(context, docs, null, null);
Sequence resultSeq = expr.eval(docs, null, null);
	protected NodeImpl[] select(DocumentSet docs)		throws PermissionDeniedException, EXistException, XPathException {		try {			StaticContext context = new StaticContext(broker);			XPathLexer2 lexer = new XPathLexer2(new StringReader(selectStmt));			XPathParser2 parser = new XPathParser2(lexer);			XPathTreeParser2 treeParser = new XPathTreeParser2(context);			parser.xpath();			if (parser.foundErrors()) {				throw new RuntimeException(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 RuntimeException(treeParser.getErrorMessage());			}			LOG.info("modification select: " + expr.pprint());			long start = System.currentTimeMillis();			docs = expr.preselect(docs, context);			if (docs.getLength() == 0)				return null;			Sequence resultSeq = expr.eval(context, docs, null, null);			if (resultSeq.getItemType() != Type.NODE)				throw new EXistException("select expression should evaluate to a" + "node-set");			NodeList set = (NodeList)resultSeq;			LOG.info("found " + set.getLength() + " for select; retrieving nodes...");			ArrayList out = new ArrayList(set.getLength());			for (int i = 0; i < set.getLength(); i++) {				out.add(set.item(i));			}			NodeImpl result[] = new NodeImpl[out.size()];			out.toArray(result);			return result;		} catch (RecognitionException e) {			LOG.warn("error while parsing select expression", e);			throw new EXistException(e);		} catch (TokenStreamException e) {			LOG.warn("error while parsing select expression", e);			throw new EXistException(e);		}	}