JDOM is an open source library which allow XML parsing and reading in
Java program. JDOM is designed by using Java programming technique and
customized for Java programmers, so that Java programmer withvery little knowledge of XML documents can
use JDOM to read XML files. Unlike DOM
Parser of Java API , which uses Factory
design pattern to create instance of parser e.g DocumentBuilderFactory and DocumentBuilder, as seen
in our last example of parsing
XML documents in Java, JDOM uses new() operator
to create its parser instances. In fact JDOM is very easy to understand and most
of the time its self explanatory. While trying this Java program to parse XML
file, you can explore JDOM API. JDOM API also allows to use XPATH
expression to query XML documents with package org.jdom2.xpath. In next
section we will see complete code example of How to read an XML file using JDOM parser in Java program.