title: How to insert/move/delete nodes in xml with Groovy?
body: <p>for example, I have the following xml document:</p>
  
  <pre><code>def CAR_RECORDS = '''
      &lt;records&gt;
        &lt;car name='HSV Maloo' make='Holden' year='2006'/&gt;
        &lt;car name='P50' make='Peel' year='1962'/&gt;
        &lt;car name='Royale' make='Bugatti' year='1931'/&gt;
      &lt;/records&gt;
  '''
  </code></pre>
  
  <p>and I want to move the car "Royale" up to first one, and insert a new car just after car"HSV Maloo", the result would be:</p>
  
  <pre><code>'''
      &lt;records&gt;
        &lt;car name='Royale' make='Bugatti' year='1931'/&gt;
        &lt;car name='HSV Maloo' make='Holden' year='2006'/&gt;
        &lt;car name='My New Car' make='Peel' year='1962'/&gt;
        &lt;car name='P50' make='Peel' year='1962'/&gt;
      &lt;/records&gt;
  '''
  </code></pre>
  
  <p>How to do it with Groovy? comments are welcome.</p>