*/
public static void exampleToWrappedSequence() throws XPathException {
final Configuration config = new Configuration();
final StaticQueryContext sqc = config.newStaticQueryContext();
final XQueryExpression exp = sqc.compileQuery("<doc><chap><a>3</a></chap></doc>//a, <b>4</b>, attribute c {5}, 19");
Properties props = new Properties();
props.setProperty(OutputKeys.OMIT_XML_DECLARATION, "no");
props.setProperty(OutputKeys.INDENT, "yes");
final DynamicQueryContext dynamicContext = new DynamicQueryContext(config);
final SequenceIterator iter = exp.iterator(dynamicContext);
final DocumentInfo doc = QueryResult.wrap(iter, config);
QueryResult.serialize(doc, new StreamResult(System.out), props);
}