public XMLStreamReader getSequenceAsStream() throws XQException {
checkNotClosed();
EventIterator ei = new EventIteratorOverSequence(iterateRemainder());
ei = new BracketedDocumentIterator(ei);
Configuration config = getConfiguration();
PipelineConfiguration pipe = config.makePipelineConfiguration();
pipe.setHostLanguage(Configuration.XQUERY);
ei = new Decomposer(ei, pipe);
return new EventToStaxBridge(ei, config.getNamePool());
}