Here you can find the source of readXML(String path)
public static Document readXML(String path)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Document; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import java.io.File; public class Main { /**/*from w ww . j av a 2 s .c o m*/ * Read xml from file */ public static Document readXML(String path) { try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); return builder.parse(new File(path)); } catch (Exception e) { e.printStackTrace(); return null; } } }