Here you can find the source of parse(InputSource in)
public static Document parse(InputSource in)
//package com.java2s; //License from project: Open Source License import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.Document; import org.xml.sax.InputSource; public class Main { public static Document parse(InputSource in) { try {//from ww w.j a v a 2 s . co m DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); return db.parse(in); } catch (Exception e) { e.printStackTrace(); return null; } } }