A simple DOM reader is presented below:
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setValidating( true );
factory.setNamespaceAware( true );
try {
// get a builder to create a DOM document
DocumentBuilder builder = factory.newDocumentBuilder();
// parse the damned document
Document d = builder.parse( "files\\myfile.xml" );
System.out.println( "the document: " + d );
}
catch( Exception e ) {
e.printStackTrace();
}