title: Using XPath with GPathResult to find all nodes and add new attribute
body: <p>Edited...
  My knowledge in Groovy is basic and I need to perform the following action which I have no idea how to do.</p>
  
  <p>let's say I have this XML:</p>
  
  <pre><code>&lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
   &lt;soap:Body&gt;
    &lt;ns2:analyzeEffectOfReplaceOfferResponse&gt;
        &lt;ns2:productOfferings&gt;
          &lt;ns2:productOffering xsi:type="ns2:ProductOfferingInstanceCore" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
             &lt;ns2:opExtn&gt;C_P87531945-0993-46d1-8f23-ed23caa6e0cf&lt;/ns2:opExtn&gt;
             &lt;ns2:productOffering&gt;
                &lt;ns9:id&gt;8447669&lt;/ns9:id&gt;
             &lt;/ns2:productOffering&gt;
             &lt;ns2:productOffering&gt;
                &lt;ns9:id&gt;8447100&lt;/ns9:id&gt;
             &lt;/ns2:productOffering&gt;
          &lt;/ns2:productOffering&gt;
       &lt;/ns2:productOfferings&gt;
    &lt;/ns2:analyzeEffectOfReplaceOfferResponse&gt;
  &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  </code></pre>
  
  <p>given an XPath expression like:</p>
  
  <pre><code>/Body/analyzeEffectOfReplaceOfferResponse/productOfferings/productOffering/productOffering
  </code></pre>
  
  <p>and GPathResult as:</p>
  
  <pre><code>gpathRequest = new XmlSlurper().parse(inputFile)
  </code></pre>
  
  <p>I know how to use findAll to search for all related tags. Let's say I stored the Xpath in a xPath variable:</p>
  
  <pre><code>def gpath = "XML." + xPaths
  child = Eval.me( 'XML', gpathRequest, gpath ).depthFirst().findAll{it.value}
  </code></pre>
  
  <p>However I am not sure how to handle the result here in form of collection. How can I add a new property after finding the result I need?</p>