There are basically three major approaches/ implementations through which which you can process XML: SAX, DOM & JAXB
SAX and DOM are generic XML parsers
They will parse any well-structured XML
JAXB creates a parser that is specific to your DTD
A JAXB parser will parse only valid XML (as defined by your DTD)
DOM and JAXB both produce a tree in memory
DOM produces a generic tree; everything is a Node
JAXB produces a tree of Objects with names and attributes as described by your DTD.
JAXP The
Java API for XML Processing (JAXP) enables applications to parse and transform XML documents independent of a particular XML processing implementation.