Here you can find the source of parseXml(String uri)
static public Document parseXml(String uri)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.*; import javax.xml.parsers.*; public class Main { static public Document parseXml(String uri) { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); try {/*w w w . j a v a2 s . co m*/ DocumentBuilder builder = factory.newDocumentBuilder(); return builder.parse(uri); } catch (Exception e) { e.printStackTrace(); return null; } } }