{
// Use the XSLTProcessorFactory to create a processor.
XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
// Compile the two stylesheets.
StylesheetRoot stylesheet = processor.processStylesheet("foo.xsl");
StylesheetRoot stylesheet2 = processor.processStylesheet("foo2.xsl");
// Don't really need to set the processor Stylesheet property, since it's
// still set from the 2nd processStylesheet, but it's good form....
processor.setStylesheet(stylesheet2);