The JAXP interface uses a factory design pattern. That is, you use factories to create objects. This hides the implementation classes.
The procedure is:
Create a TransformerFactory instance.
Load your stylesheet into a Transformer instance.
Transform your source to your output using the Transfomer instance.
// Step 1: Establishes the factory/environment/etc. TransformerFactory tfactory = TransformerFactory.newInstance(); // Step 2: Loads and compiles the stylesheet Transformer xform = tfactory.newTransformer(new StreamSource("mystyle.xsl")); // Step 3: Apply the transform to the input document xform.transform(new StreamSource("in.xml"),new StreamSource("out.xhtml"));