File dataFile = new File(args[2]); // data
try {
InputStream dataStream = new FileInputStream(dataFile);
InputStream styleStream = new FileInputStream(styleFile);
// create XSLT Source and Result objects
Source data = new StreamSource(dataStream);
Source style = new StreamSource(styleStream);
Result output = new StreamResult(System.out);
// create Transformer and perform the tranfomation
Transformer xslt = TransformerFactory.newInstance().newTransformer(style);
xslt.transform(data, output);
}