Java tutorial
//package com.java2s; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import org.w3c.dom.Document; public class Main { public static Document getDOMMaker() throws ParserConfigurationException { //get an instance of factory DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); //get an instance of builder DocumentBuilder db = dbf.newDocumentBuilder(); //create an instance of DOM Document dom = db.newDocument(); return dom; } }