private static Document createXML ( String root , boolean useNamespace ) { try { org . w3c . dom . Document doc = getDocumentBuilder ( null , useNamespace ) . newDocument ( ) ; doc . appendChild ( doc . createElement ( root ) ) ; return new DocumentImpl ( doc ) ; } catch ( Exception e ) { throw new DomException ( e ) ; } }
Helper method for XML document creation .