LOG.info("found " + out.size() + " for select");
	protected NodeImpl[] select(DocumentSet docs) throws PermissionDeniedException, EXistException {		try {			XPathLexer lexer = new XPathLexer(new StringReader(selectStmt));			XPathParser parser = new XPathParser(pool, user, lexer);			PathExpr expr = new PathExpr(pool);            RootNode root = new RootNode(pool);            expr.add(root);			parser.expr(expr);			LOG.info("modification select: " + expr.pprint());			long start = System.currentTimeMillis();			if (parser.foundErrors())				throw new RuntimeException(parser.getErrorMsg());			docs = expr.preselect(docs);			if (docs.getLength() == 0)				return null;						Value resultValue = expr.eval(docs, null, null);            if(!(resultValue.getType() == Value.isNodeList))                throw new EXistException("select expression should evaluate to a" +                    "node-set");            NodeList set = resultValue.getNodeList();            ArrayList out = new ArrayList(set.getLength());            for(int i = 0; i < set.getLength(); i++) {            	out.add(set.item(i));            }            LOG.info("found " + out.size() + " for select");            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);		}	}