Extensible Markup Language (XML) is a set of rules for encoding documents in machine-readable form. It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications.
The material in this section is based on the XML Specification. This is not an exhaustive list of all the constructs which appear in XML; it provides an introduction to the key constructs most often encountered in day-to-day use. XML documents may begin by declaring some information about themselves, as in the following example.
In Java, 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 and JDOM xml parser.
The DOM interface is the easiest to understand. It parses an entire XML document and load it into memory, modeling it with Object for the traversal. DOM Parser is slow and consume a lot memory if it load a XML document which contains a lot of data.
now we try to create XML files using XML DOM Parser.
XML file can be edited for each element in its node can query the results table. XML file from the query table.