# setAttribute

Set an attribute into elements matched by an XPath expression.

Sample request:

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.xservices.brutex.net">
       <soapenv:Header/>
       <soapenv:Body>
          <ws:setAttribute>
             <sourcexml>
             <![CDATA[<notes xmlns="http://demo.brutex.net">
    	<note>
    		<to>Lena</to>
    		<from>Jani</from>
    		<heading>Reminder ABC</heading>
    		<body>Don't forget me this weekend!</body>
    	</note>
    	<note>
    		<to>John</to>
    		<from>Lena</from>
    		<heading>Call Mr. ABC</heading>
    		<body>Please call back</body>
    	</note>
    </notes>
    ]]></sourcexml>
             <encoding>utf-8</encoding>
             <!--Optional:-->
             <namespaceList>
                <!--Zero or more repetitions:-->
                <namespace>
                   <prefix>bx</prefix>
                   <uri>http://demo.brutex.net</uri>
                </namespace>
             </namespaceList>
             <xpath>*/bx:note</xpath>
             <attribute>
                <name>priority</name>
                <!--Optional:-->
                <value>high</value>
             </attribute>
          </ws:setAttribute>
       </soapenv:Body>
    </soapenv:Envelope>

Sample response:

    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
       <soap:Body>
          <ns2:setAttributeResponse xmlns:ns2="http://ws.xservices.brutex.net">
             <return><![CDATA[<?xml version='1.0' encoding='UTF-8'?>
             <notes xmlns="http://demo.brutex.net">
    	<note xmlns:axis2ns16="http://demo.brutex.net" axis2ns16:priority="high">
    		<to>Lena</to>
    		<from>Jani</from>
    		<heading>Reminder ABC</heading>
    		<body>Don't forget me this weekend!</body>
    	</note>
    	<note xmlns:axis2ns17="http://demo.brutex.net" axis2ns17:priority="high">
    		<to>John</to>
    		<from>Lena</from>
    		<heading>Call Mr. ABC</heading>
    		<body>Please call back</body>
    	</note>
    </notes>]]></return>
          </ns2:setAttributeResponse>
       </soap:Body>
    </soap:Envelope>