Sequence seq = expr.eval(context, docs, null, null);
Sequence seq = expr.eval(docs, null, null);
	protected void processXInclude(Attributes atts) throws SAXException {		// save some settings		DocumentImpl prevDoc = document;		boolean createContainerElements = serializer.createContainerElements;		serializer.createContainerElements = false;		// parse the href attribute		String href = atts.getValue("href");		if (href != null) {			LOG.debug("found href=\"" + href + "\"");			String xpointer = null;			String docName = href;			// try to find xpointer part			int p = href.indexOf('#');			if (-1 < p) {				docName = href.substring(0, p);				xpointer = XMLUtil.decodeAttrMarkup(href.substring(p + 1));				LOG.debug("found xpointer: " + xpointer);			}			// if docName has no collection specified, assume			// current collection 			p = docName.lastIndexOf('/');			if (p < 0)				docName = document.getCollection().getName() + '/' + docName;			// retrieve the document			LOG.debug("loading " + docName);			DocumentImpl doc = null;			try {				doc = (DocumentImpl) serializer.broker.getDocument(docName);			} catch (PermissionDeniedException e) {				LOG.warn("permission denied", e);				throw new SAXException(e);			}			/* if document has not been found and xpointer is			 * null, throw an exception. If xpointer != null			 * we retry below and interpret docName as			 * a collection.			 */			if (doc == null && xpointer == null)				throw new SAXException("document " + docName + " not found");			if (xpointer == null)				// no xpointer found - just serialize the doc				serializer.serializeToSAX(doc, false);			else {				// process the xpointer				try {					// build input document set					DocumentSet docs = null;					if (doc == null) {						// try to read documents from the collection						// specified by docName						docs = serializer.broker.getDocumentsByCollection(docName);						// give up						if (docs == null)							throw new SAXException(								"no document or collection " + "called " + docName);					} else {						docs = new DocumentSet();						docs.add(doc);					}					StaticContext context = new StaticContext(serializer.broker);					xpointer = checkNamespaces(context, xpointer);					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(xpointer));					XPathParser2 parser = new XPathParser2(lexer);					XPathTreeParser2 treeParser = new XPathTreeParser2(context);					parser.xpointer();					if (parser.foundErrors()) {						throw new SAXException(parser.getErrorMessage());					}					AST ast = parser.getAST();					LOG.debug("generated AST: " + ast.toStringTree());					PathExpr expr = new PathExpr();					treeParser.xpointer(ast, expr);					if (treeParser.foundErrors()) {						throw new SAXException(treeParser.getErrorMessage());					}					LOG.info("xpointer query: " + expr.pprint());					long start = System.currentTimeMillis();					docs = expr.preselect(docs, context);					if (docs.getLength() == 0)						return;					Sequence seq = expr.eval(context, docs, null, null);					switch (seq.getItemType()) {						case Type.NODE :							NodeSet set = (NodeSet) seq;							LOG.info("xpointer found: " + set.getLength());							NodeProxy proxy;							for (Iterator i = set.iterator(); i.hasNext();) {								proxy = (NodeProxy) i.next();								serializer.serializeToSAX(proxy, false);							}							break;						default :							String val;							for (int i = 0; i < seq.getLength(); i++) {								val = seq.itemAt(i).getStringValue();								characters(val.toCharArray(), 0, val.length());							}							break;					}				} catch (RecognitionException e) {					LOG.warn("xpointer error", e);					throw new SAXException(e);				} catch (TokenStreamException e) {					LOG.warn("xpointer error", e);					throw new SAXException(e);				} catch (PermissionDeniedException e) {					LOG.warn("xpointer error", e);					throw new SAXException(e);				} catch (XPathException e) {					throw new SAXException(e);				}			}		}		// restore settings		document = prevDoc;		serializer.createContainerElements = createContainerElements;	}