Collogues, i have cycle which create soap xml with nessesary structure (don't ask about the structure) 

```
log.info("Body elements: ");
NodeList nodeList = body.getElementsByTagName("*") ;
for (int i = 0; i < nodeList.getLength(); i++) {
    Node node = nodeList.item(i);
    if (node.getNodeType() == Node.ELEMENT_NODE) {
        log.info(node.getNodeName());

        if (node.getNodeName().equals("ns2:request")) {
            log.info("Set namespace and prefix for " + node.getNodeName());
            SOAPElement childX = (SOAPElement) node;
            childX.removeNamespaceDeclaration(childX.getPrefix()) ;
            childX.addNamespaceDeclaration("ns3", "http://mayacomp/Generic/Ws");
            childX.setPrefix("ns3");
        }

        else {                        
            if (node.getNodeName().equals("ns2:in") ) {
                log.info("Remove namespace for  " + node.getNodeName());
                SOAPElement childX = (SOAPElement) node;
                childX.removeNamespaceDeclaration(childX.getPrefix()) ;
                childX.addNamespaceDeclaration("", "");
                childX.setPrefix("");
            }

            SOAPElement childX = (SOAPElement) node;
            childX.removeNamespaceDeclaration(childX.getPrefix()) ;
            childX.setPrefix("");
        }
    }
}

```

As a result I receive xml:

```
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <ns3:request xmlns:ns3="http://mayacomp/Generic/Ws">
         <in xmlns="http://mayacomp/Generic/Ws">
            <requestHeader>

```

My question is how to remove only `xmlns="http://mayacomp/Generic/Ws"` from `<in>` element and receive:

```
   <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
       <soapenv:Body>
          <ns3:request xmlns:ns3="http://mayacomp/Generic/Ws">
             <in>
                <requestHeader>

```

**UPDATE** 

I tried to config xml element:

```
    /*Config body elements*/
                while (itBodyElements.hasNext()) 
                {  
                  Object o = itBodyElements.next();
                  SOAPBodyElement bodyElement = (SOAPBodyElement) o;
                  log.info("Elements from 'Body' element = " + bodyElement.getLocalName() );

                  Iterator it2 = bodyElement.getChildElements();
                         while (it2.hasNext()) 
                         { 
                              Object requestElement = it2.next();
                              SOAPBodyElement bodyRequest = (SOAPBodyElement) requestElement;
                              log.info("  Elements from '"+ bodyElement.getLocalName() + "' element = " + bodyRequest.getLocalName()); 
                              log.info("  Delete namespace from IN element " + bodyRequest.getLocalName());
                              bodyRequest.removeNamespaceDeclaration(bodyRequest.getPrefix());
                              bodyRequest.setPrefix("");

                               Iterator it3 = bodyRequest.getChildElements();
                                    while (it3.hasNext())
                                    { //work with other elements

```

But it has not effect to 'in' element. After run i still have:
`<in xmlns="http://mayacomp/Generic/Ws">`

**UPDATE**

I solved the problem by calling ws as next:

```
getWebServiceTemplate().marshalSendAndReceive(
                "URL",
                request,
                new WebServiceMessageCallback()
                { public void doWithMessage(WebServiceMessage message) {

                        SaajSoapMessage saajSoapMessage = (SaajSoapMessage)message;

                        SOAPMessage soapMessage = UtilsClass.createSOAPMessage(in);

                        saajSoapMessage.setSaajMessage(soapMessage);

                }

                } 
                );

```

Method **createSOAPMessage** configure soap message using javax.xml.soap library.