title: How to add elements to DOMNodeList in PHP?
body: <p>Is there a way to create my own DOMNodeList? E.g.:</p>
  
  <pre><code>$doc = new DOMDocument(); 
  $elem = $doc-&gt;createElement('div');
  $nodeList = new DOMNodeList; 
  $nodeList-&gt;addItem($elem); // ?
  </code></pre>
  
  <p>My idea is to extend DOMDocument class adding some useful methods that return data as DOMNodeList. </p>
  
  <p>Is it possible to do it without writing my own version of DOMNodeList class? </p>