title: "undefined method DOMDocument::addChild()" on simple create XML sript
body: <p>I'm getting an error on the following snippet: </p>
  
  <pre><code>1 $xml = new DOMDocument('1.0', 'utf-8');
  2 $xml-&gt;formatOutput = TRUE; // enable automatic indenting
  3   $xml-&gt;loadXML('&lt;songData/&gt;'); // set root node  
  4   $song       = $xml-&gt;addChild('song');
  5   $artist     = $xml-&gt;addChild('artist');
  6   
  7   echo $xml-&gt;asXML();
  </code></pre>
  
  <p>That returns: </p>
  
  <pre><code>Call to undefined method DOMDocument::addChild() on line 4
  </code></pre>
  
  <p>What is going on to trigger this error?</p>
  
  <p>Edit, Ultimately I am going for something like this: </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;songData&gt;
      &lt;song&gt;
          &lt;title&gt;Carbona Not Glue&lt;/title&gt;
          &lt;artist&gt;Ramones&lt;/artist&gt;
          &lt;members&gt;
              &lt;name&gt;Johny&lt;/name&gt;
              &lt;name&gt;Joey&lt;/name&gt;
              &lt;name&gt;Dee Dee&lt;/name&gt;
             &lt;name&gt;Marky&lt;/name&gt;
          &lt;/members&gt;
      &lt;/song&gt;
  &lt;/songData&gt;
  </code></pre>