In Java JDK, two built-in XML parsers are available – DOM and SAX, both have their pros and cons. Here’s few examples to show how to create, modify and read a XML file with Java DOM, SAX, JDOM.
In addition, updated JAXB example to show you how to convert object to / from XML.