Showing posts with label xml. Show all posts
Showing posts with label xml. Show all posts

Sunday, May 22, 2011

Document to String

 DOMSource domSource = new DOMSource(document); //org.w3c.dom.Document document = null;  
 StringWriter writer = new StringWriter();  
 StreamResult result = new StreamResult(writer);  
 TransformerFactory tranFact = TransformerFactory.newInstance();  
 Transformer transfor = tranFact.newTransformer();  
 transfor.transform(domSource, result);  
 String returnXML=writer.toString();