public static void exampleToHTMLFile() throws XPathException, IOException {
final Configuration config = new Configuration();
final StaticQueryContext sqc = config.newStaticQueryContext();
final XQueryExpression exp = sqc.compileQuery(new FileReader("query/books-to-html.xq"));
final DynamicQueryContext dynamicContext = new DynamicQueryContext(config);
dynamicContext.setContextItem(config.buildDocument(new StreamSource("data/books.xml")));
final Properties props = new Properties();
props.setProperty(OutputKeys.METHOD, "html");
props.setProperty(OutputKeys.DOCTYPE_PUBLIC, "-//W3C//DTD HTML 4.01 Transitional//EN");
exp.run(dynamicContext, new StreamResult(new File("booklist.html")), props);
}