We need an instance of DocumentBuilder to create Document object that will map the XML file in memory. Following example will show how to do it:

Java Code:
File file = new File("C:\\myFile.xml");
DocumentBuilder builder =
DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document doc = builder.parse(file);