Here you can find the source of getXML(File xmlFile)
public static Document getXML(File xmlFile) throws ParserConfigurationException, IOException, SAXException
//package com.java2s; import org.w3c.dom.Document; import org.xml.sax.SAXException; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import java.io.*; public class Main { public static Document getXML(File xmlFile) throws ParserConfigurationException, IOException, SAXException { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.parse(xmlFile); document.getDocumentElement().normalize(); return document; }// www . java2s . c om }