Hi,
Ok, so if I may suggest the use of XMLSlurper, which is built into Groovy so requires no imports and is quote neat. Then if we put your XML snippet (similar typed in by me) into a file /work/SoapUI Forum/soapy.xml:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope">
<soap:Header/>
<soap:Body>
<tem:Add xmlns:tem="http://tempuri.org">
<tem:intA>5</tem:intA>
<tem:intB>7</tem:intB>
</tem:Add>
</soap:Body>
</soap:Envelope>
Then, the following Groovy script allows you to parse the XML from file, update the values of intA and intB and save the resulting XML back to the same file:
import groovy.xml.XmlUtil
def xmlFromFile = new File('/work/SoapUI Forum/soapy.xml')
def envelopeNode = new XmlSlurper().parseText(xmlFromFile.getText())
envelopeNode.Body.Add.intA=5
envelopeNode.Body.Add.intB=7
//Just to print it out
XmlUtil xmlUtil = new XmlUtil()
log.info xmlUtil.serialize(envelopeNode)
//To update the file with updated XML
xmlUtil.serialize(envelopeNode, new FileWriter(xmlFromFile))
Is this what you needed?
Cheers,
Rup