DocumentSet ndocs = expr.preselect(documentSet);
DocumentSet ndocs = expr.preselect(documentSet, context);
	private List processQuery(String select) throws SAXException {		try {			StaticContext context = new StaticContext(user);			Map.Entry entry;			for (Iterator i = namespaces.entrySet().iterator(); i.hasNext();) {				entry = (Map.Entry) i.next();				context.declareNamespace(					(String) entry.getKey(),					(String) entry.getValue());			}			XPathLexer2 lexer = new XPathLexer2(new StringReader(select));			XPathParser2 parser = new XPathParser2(lexer);			XPathTreeParser2 treeParser = new XPathTreeParser2(pool, context);			parser.xpath();			if (parser.foundErrors()) {				throw new SAXException(parser.getErrorMessage());			}			AST ast = parser.getAST();			LOG.debug("generated AST: " + ast.toStringTree());			PathExpr expr = new PathExpr(pool);			treeParser.xpath(ast, expr);			if (treeParser.foundErrors()) {				throw new SAXException(treeParser.getErrorMessage());			}			DocumentSet ndocs = expr.preselect(documentSet);			if (ndocs.getLength() == 0)				return new ArrayList(1);			Value resultValue = expr.eval(context, documentSet, null, null);			if (!(resultValue.getType() == Value.isNodeList))				throw new SAXException(					"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));			}			return out;		} catch (RecognitionException e) {			LOG.warn("error while creating variable", e);			throw new SAXException(e);		} catch (TokenStreamException e) {			LOG.warn("error while creating variable", e);			throw new SAXException(e);		} catch (XPathException e) {			throw new SAXException(e);		}	}