public static org . w3c . dom . Document getW3cDocument ( JsonElement value , String rootName ) { Element root = getElement ( value , rootName ) ; try { DocumentBuilderFactory factory = DocumentBuilderFactory . newInstance ( ) ; factory . setNamespaceAware ( true ) ; DocumentBuilder builder = factory . newDocumentBuilder ( ) ; DOMImplementation impl = builder . getDOMImplementation ( ) ; return DOMConverter . convert ( new Document ( root ) , impl ) ; } catch ( ParserConfigurationException e ) { throw new IllegalStateException ( e ) ; } }
Convert any JsonElement into an w3c DOM tree .