Node doc = null;
// read document
DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
domFactory.setNamespaceAware(true);
domFactory.setValidating(false);
DocumentBuilder builder = domFactory.newDocumentBuilder();
doc = builder.parse(new FileInputStream("F:/xml/xml.xml"));
String xslfile = "F:/xml/xsl.xsl";
String htmlfile = "F:/xml/rsult.html";
TransformerFactory tf = TransformerFactory.newInstance();
Source xml = new DOMSource(doc);
Source xsl = new StreamSource(xslfile);
Result html = new StreamResult(htmlfile);
Transformer tran = tf.newTransformer(xsl);
tran.transform(xml,html);