title: Removing first line from string in Groovy
body: <p>With Groovy I need to read an XML file and remove the first line containing the XML declaration.</p>
  
  <p><strong>Source content</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;myxmldoc&gt;
    content
  &lt;/myxmldoc&gt;
  </code></pre>
  
  <p><strong>Target content</strong></p>
  
  <pre><code>&lt;myxmldoc&gt;
    content
  &lt;/myxmldoc&gt;
  </code></pre>
  
  <p><strong>My code so far...</strong>
  Reading all lines except the first line from the file into a list. Then, building a new string by adding each line to the next.</p>
  
  <pre><code>def soapBodyList = new File(inputFilename).readLines()
  soapBodyList = soapBodyList[1..soapBodyList.size-1]
  
  def soapBody = ""
  soapBodyList.each {
      soapBody += it
  }
  
  return soapBody
  </code></pre>
  
  <p>However I feel that there must be a simpler way to just remove the first line abnd have the result as a string.</p>