Here you can find the source of createDoc(SOAPMessage soapMsg)
private static Document createDoc(SOAPMessage soapMsg) throws TransformerException, SOAPException, IOException
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Document; import javax.xml.soap.*; import javax.xml.transform.Source; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMResult; import java.io.IOException; public class Main { private static Document createDoc(SOAPMessage soapMsg) throws TransformerException, SOAPException, IOException { Source src = soapMsg.getSOAPPart().getContent(); TransformerFactory tf = TransformerFactory.newInstance(); Transformer transformer = tf.newTransformer(); DOMResult result = new DOMResult(); transformer.transform(src, result); return (Document) result.getNode(); }/*ww w. j ava 2 s .c o m*/ }