Create XML file in Java using JDOM parser

0 Flares Twitter 0 Facebook 0 Google+ 0 LinkedIn 0 0 Flares ×

Let us see how we can use the JDOM parser to create XML file from Java Objects ( Marshalling).JDOM is a java representation of an XML document. JDOM is not related to the W3C’s DOM and is a Java based document object model for XML. The purpose of both DOM and JDOM are same but JDOM is much simpler and easier to use. JDOM is not an XML parser but a document object model that uses parser’s to construct documents.The default XML parser used by JDOM is the JAXP-selected parser, but JDOM can use nearly any parser.


The XML file we intend to generate is

Java Code


Read XML using JDOM