code: public static Document createSoapMessage(String version, List headerBlocks,
              Element body) throws Exception {
          Document message = null;
          NodeList children = body.getChildNodes();
          // Loop in order to remove dummy nodes (spaces, CR)
          for (int i = 0; i < children.getLength(); i++) {
              if (children.item(i).getNodeType() != Node.ELEMENT_NODE && children.item(i).getNodeType() == Node.TEXT_NODE) {
              	Document bodyDoc = DomUtils.convertToElementNode(body.getTextContent().trim());
  				if(bodyDoc.getFirstChild().getNodeType() == Node.ELEMENT_NODE){
  					body = (Element) bodyDoc.getFirstChild();
  				}
              }
                  if (version.equals(SOAP_V_1_1)) {
                      message = Soap11MessageBuilder.getSoapMessage(headerBlocks,
                              body);
                  } else {
                      message = Soap12MessageBuilder.getSoapMessage(headerBlocks,
                              body);
                  }
              break;
          }
          return message;
      }
docs: A method to create a SOAP message. The SOAP message, including the Header
  is created and returned as DOM Document.
  
  @param version
  the SOAP version to be used (1.1 or 1.2).
  @param headerBlocks
  the list of Header Blocks to be included in the SOAP Header .
  @param body
  the XML message to be included in the SOAP BODY element.
  
  @return The created SOAP message as document.
  
  @author Simone Gianfranceschi