Example 5: Parsing an XML file in Java.

// Create a DOMParser
DOMParser parser = new DOMParser();
// Parse the specified file
parser.parse("/myDocuments/myDocument.xml");
Document doc = parser.getDocument();