# replaceNodes

Replace an xml fragment with another xml fragment. This operation is namespace aware.

Sample request:

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:ws="http://ws.xservices.brutex.net">
       <soapenv:Header/>
       <soapenv:Body>
          <ws:replaceNodes>
             <sourcexml><![CDATA[
             <books>
    			<author>
    				<name>Mensiok</name>
    				<surname>Bello</surname>
    			</author>
    			<author>
    				<name>Schwab</name>
    				<surname>Rumsau</surname>
    			</author>
    			<author>
    				<name>Dollibert</name>
    				<surname>Rach</surname>
    			</author>
             </books>
             ]]>
             </sourcexml>
             <encoding>utf-8</encoding>
             <namespaceList>
                <!--Zero or more repetitions:-->
                <namespace>
                   <prefix></prefix>
                   <uri></uri>
                </namespace>
             </namespaceList>
             <xpath>*/name[text()='Schwab']</xpath>
             <!--Optional:-->
             <xmldata><![CDATA[<name>Meyer</name><age>45</age><!--edited here-->]]></xmldata>
          </ws:replaceNodes>
       </soapenv:Body>
    </soapenv:Envelope>

Sample response:

    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
       <soap:Body>
          <ns2:replaceNodesResponse xmlns:ns2="http://ws.xservices.brutex.net">
             <return><![CDATA[<?xml version='1.0' encoding='UTF-8'?>
             <books>
    			<author>
    				<name>Mensiok</name>
    				<surname>Bello</surname>
    			</author>
    			<author>
    				<name>Meyer</name><age>45</age><!--edited here-->
    				<surname>Rumsau</surname>
    			</author>
    			<author>
    				<name>Dollibert</name>
    				<surname>Rach</surname>
    			</author>
             </books>]]></return>
          </ns2:replaceNodesResponse>
       </soap:Body>
    </soap:Envelope>