doc为你创建的Document,
      StreamSource xslSource = new StreamSource(new File("your xsl's location"));      
      DOMSource domSrc = new DOMSource(doc);      TransformerFactory tf = TransformerFactory.newInstance();
      Transformer t = tf.newTransformer(xslSource);      
      StringWriter sw = new StringWriter();
      t.transform(domSrc, new StreamResult(sw));sw 即是transform 后的结果!