code: private void addSoapBody(SoapMessage response, Message replyMessage) throws TransformerException {
          if (!(replyMessage.getPayload() instanceof String) || 
                  StringUtils.hasText(replyMessage.getPayload(String.class))) {
              Source responseSource = getPayloadAsSource(replyMessage.getPayload());
              
              TransformerFactory transformerFactory = TransformerFactory.newInstance();
              Transformer transformer = transformerFactory.newTransformer();
              
              transformer.transform(responseSource, response.getPayloadResult());
          }
      }
docs: Add message payload as SOAP body element to the SOAP response.
  @param response
  @param replyMessage