Before you dive into using JAXP to manipulate XML files, we need to define the components that make up XML documents.
The core of an XML document is the document itself. It consists of the following components:
Prolog. Contains version information, comments, and references to Document Type Definition (DTD) files.
Body. Contains a document root and sub-elements.
Epilog. Contains comments and processing instructions.
Listing 12.1 shows a simple XML file that might be used in a bookstore to define a set of books.
<!DOCTYPE books SYSTEM "Books.dtd"> <books> <book category="computer-programming"> <author>Steven Haines</author> <title>Java 2 From Scratch</title> <price>39.95</price> ...