XQueryLexer lexer = new XQueryLexer(new StringReader(select));
XQueryLexer lexer = new XQueryLexer(context, new StringReader(select));
	private List processQuery(String select) throws SAXException {		try {			XQueryContext context = new XQueryContext(broker);			context.setStaticallyKnownDocuments(documentSet);			Map.Entry entry;			for (Iterator i = namespaces.entrySet().iterator(); i.hasNext();) {				entry = (Map.Entry) i.next();				context.declareNamespace(					(String) entry.getKey(),					(String) entry.getValue());			}			XQueryLexer lexer = new XQueryLexer(new StringReader(select));			XQueryParser parser = new XQueryParser(lexer);			XQueryTreeParser treeParser = new XQueryTreeParser(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(context);			treeParser.xpath(ast, expr);			if (treeParser.foundErrors()) {				throw new SAXException(treeParser.getErrorMessage());			}			Sequence seq = expr.eval(null, null);			if (!(seq.getItemType() == Type.NODE))				throw new SAXException(					"select expression should evaluate to a" + "node-set");			NodeList set = (NodeList)seq;			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);		}	}