// Create a transformer object
Transformer tx = TransformerFactory.newInstance().newTransformer(
new StreamSource(new File("parents.xsl")));
// Use its transform() method to perform the transformation
tx.transform(
new StreamSource(new File("parents+dtd.xml")),
new StreamResult(System.out));