// Cast the TransformerFactory to SAXTransformerFactory.
SAXTransformerFactory saxTFactory = ((SAXTransformerFactory) tFactory);
// Create a TransformerHandler for each stylesheet.
TransformerHandler tHandler1 = saxTFactory.newTransformerHandler(new StreamSource("foo1.xsl"));
TransformerHandler tHandler2 = saxTFactory.newTransformerHandler(new StreamSource("foo2.xsl"));
TransformerHandler tHandler3 = saxTFactory.newTransformerHandler(new StreamSource("foo3.xsl"));
// Create an XMLReader.
XMLReader reader = XMLReaderFactory.createXMLReader();
reader.setContentHandler(tHandler1);
reader.setProperty("http://xml.org/sax/properties/lexical-handler", tHandler1);