DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
URL testContext = this.getClass().getResource(testFile);
Document doc = docBuilder.parse(testContext.openStream());
XPath xpath = XPathFactory.newInstance().newXPath();
xpath.setNamespaceContext(new XPathNamespaceContext(true));
template = PageTemplateImpl.fromXml(doc.getFirstChild(), xpath);
composeable = (PageTemplateImpl)template;
}