Write Dom to Xml File (Transformer)

This example show you how to construct a Java Document Object Model (DOM) using DOM API and then write the DOM object into XML file.
 

Example Output : justexample.xml

Reference
http://docs.oracle.com/javase/1.5.0/docs/api/javax/xml/transform/Transformer.html#transform(javax.xml.transform.Source, javax.xml.transform.Result)

read more