title: Replace XML path with a string in groovy file
body: <p>I'm trying to replace a xml rootnode with a string, but it doesn't allow me.</p>
  
  <p>I was trying to give it as 
  <code>String str = "SOAP-ENV:Body'.'ns1:creditCardResponse";</code></p>
  
  <p>I should not repeat <code>SOAP-ENV:Body'.'ns1:creditCardResponse</code> in all these lines.</p>
  
  <pre><code> def rootnode = new XmlParser().parseText(responseXml);
   status = rootnode.'SOAP-ENV:Body'.'ns1:creditCardResponse'.return.Status.text();
   errorCode = rootnode.'SOAP-ENV:Body'.'ns1:creditCardResponse'.return.Errorcode.text();
   errorInfo = rootnode.'SOAP-ENV:Body'.'ns1:creditCardResponse'.return.Errorinfo.text();
   referenceCode = rootnode.'SOAP-ENV:Body'.'ns1:creditCardResponse'.return.ReferenceCode.text();
   requestIp = rootnode.'SOAP-ENV:Body'.'ns1:creditCardResponse'.return.RequestIP.text()
  </code></pre>
  
  <p>Any ideas would be greatly appreciated.</p>
  
  <p>Thanks.</p>