public static Document createDomDocument ( ) throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory . newInstance ( ) ; factory . setNamespaceAware ( true ) ; DocumentBuilder builder = factory . newDocumentBuilder ( ) ; return builder . newDocument ( ) ; }
Simple method to create an empty well - formed DOM Document