public static void exampleToStreamResult() throws XPathException {
final Configuration config = new Configuration();
final StaticQueryContext sqc = config.newStaticQueryContext();
final XQueryExpression exp = sqc.compileQuery("<a b='c'>{5+2}</a>");
final DynamicQueryContext dynamicContext = new DynamicQueryContext(config);
final Properties props = new Properties();
props.setProperty(OutputKeys.METHOD, "xml");
props.setProperty(OutputKeys.INDENT, "yes");
exp.run(dynamicContext, new StreamResult(System.out), props);
}