### Question:
PayloadHelper { public static void setXMLPayload(SOAPEnvelope envelope, OMElement element) { SOAPBody body = envelope.getBody(); if (body == null) { SOAPVersion version = envelope.getVersion(); if (version.getEnvelopeURI().equals( SOAP11Version.SOAP_ENVELOPE_NAMESPACE_URI)) { body = OMAbstractFactory.getSOAP11Factory().createSOAPBody(); } else { body = OMAbstractFactory.getSOAP12Factory().createSOAPBody(); } if (envelope.getHeader() != null) { envelope.getHeader().insertSiblingAfter(body); } else { envelope.addChild(body); } } else { for (Iterator it = body.getChildren(); it.hasNext();) { OMNode node = (OMNode) it.next(); node.discard(); } } body.addChild(element); }  static int getPayloadType(SOAPEnvelope envelope); static int getPayloadType(MessageContext mc); static OMElement getXMLPayload(SOAPEnvelope envelope); static void setXMLPayload(SOAPEnvelope envelope, OMElement element); static void setXMLPayload(MessageContext mc, OMElement element); static DataHandler getBinaryPayload(SOAPEnvelope envelope); static DataHandler getBinaryPayload(MessageContext mc); static void setBinaryPayload(SOAPEnvelope envelope, DataHandler dh); static void setBinaryPayload(MessageContext mc, DataHandler dh); static String getTextPayload(SOAPEnvelope envelope); static String getTextPayload(MessageContext mc); static void setTextPayload(SOAPEnvelope envelope, String text); static void setTextPayload(MessageContext mc, String text); static SimpleMap getMapPayload(SOAPEnvelope envelope); static SimpleMap getMapPayload(MessageContext mc); static void setMapPayload(SOAPEnvelope envelope, SimpleMap map); static void setMapPayload(MessageContext mc, SimpleMap map); static XMLStreamReader getStAXPayload(SOAPEnvelope envelope); static XMLStreamReader getStAXPayload(MessageContext mc); static void setStAXPayload(SOAPEnvelope envelope, XMLStreamReader streamReader); static void setStAXPayload(MessageContext mc, XMLStreamReader streamReader); final static String AXIOMPAYLOADNS; final static QName BINARYELT; final static QName TEXTELT; final static QName MAPELT; final static int XMLPAYLOADTYPE; static final Log log; }### Answer:
@Test public void testSetXmlPayload() throws Exception { SOAP11Factory factory = new SOAP11Factory(); SOAPEnvelope envelope = factory.getDefaultEnvelope(); OMElement element = AXIOMUtil.stringToOM("<name><value>Test</value></name>"); PayloadHelper.setXMLPayload(envelope, element); Assert.assertEquals("Couldn't set payload!", "name", envelope.getBody().getFirstElementLocalName()); }