question: public static Document stringToDom ( String xmlString , boolean useNamespaces ) throws SAXException { DocumentBuilderFactory factory = DocumentBuilderFactory . newInstance ( ) ; factory . setNamespaceAware ( useNamespaces ) ; StringReader reader = new StringReader ( xmlString ) ; InputSource input = new InputSource ( reader ) ; DocumentBuilder builder ; try { builder = factory . newDocumentBuilder ( ) ; } catch ( ParserConfigurationException e ) { log . fatal ( "### Error - this should never happen: " + e . getMessage ( ) ) ; return null ; } Document dom ; try { dom = builder . parse ( input ) ; } catch ( IOException e ) { log . fatal ( "### Error - this should never happen: " + e . getMessage ( ) ) ; return null ; } return dom ; }
target:  Converts a String to a DOM. Sometimes, you might prefer DOM to SOAPElement.