title: How is possible add child to the specific node
body: <p>This is my starting xml :</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
      &lt;root&gt;
        &lt;child&gt;
          &lt;children&gt;&lt;/children&gt;
       &lt;/child&gt;
      &lt;/root&gt;
  </code></pre>
  
  <p>and I wanna add other children in child?? but I'm trying and nothing I don't know how... :S help pls I want to my xml be to like this</p>
  
  <pre><code>  &lt;?xml version="1.0" encoding="utf-8"?&gt;
      &lt;root&gt;
        &lt;child&gt;
          &lt;children&gt;&lt;/children&gt;
          &lt;children&gt;&lt;/children&gt;
       &lt;/child&gt;
      &lt;/root&gt;
  </code></pre>
  
  <p>Here is my code :</p>
  
  <pre><code>&lt;?php
              $dom = new DomDocument;
              //$dom-&gt;preserveWhiteSpace = FALSE;
              $dom-&gt;load("myXML.xml");
              $root = $dom-&gt;getElementById('root');
              $params = $dom-&gt;getElementsByTagName('child');
              $cantidadCategorias = $params-&gt;length+1;
  
              $newElement = $dom-&gt;createElement('child','');
              $dom-&gt;appendChild($newElement);
              $f = fopen("myXML.xml",'w+'); 
              fwrite($f,$dom-&gt;saveXML()); 
              fclose($f); 
  </code></pre>