title: Symfony2 DomCrawler remove nodes from DOMElement
body: <p>I have this HTML:</p>
  
  <pre><code>&lt;div class="body"&gt;
     &lt;p&gt;Some text 1&lt;/p&gt;
     &lt;h2&gt;Header 2&lt;/h2&gt;
     &lt;p&gt;Actual content&lt;/p&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I want to get from it everything except <code>&lt;h2&gt;</code> so it would look like this:</p>
  
  <pre><code>&lt;p&gt;Some text 1&lt;/p&gt;
  &lt;p&gt;Actual content&lt;/p&gt;
  </code></pre>
  
  <p>Trying to achieve this:</p>
  
  <pre><code>$crawler = new Crawler( $html );
  
  $body = $crawler-&gt;filter( 'div.body' );
  $body-&gt;rewind();
  $body = $body-&gt;current();
  
  $h2 = $crawler-&gt;filter('h2');
  $h2-&gt;rewind();
  $h2 = $h2-&gt;current();
  
  $body-&gt;removeChild($h2);
  </code></pre>
  
  <p>But I get:</p>
  
  <blockquote>
    <p>[DOMException] Not Found Error</p>
  </blockquote>
  
  <p>What am I missing?</p>