title: Append child to xml based on attribute of the parent node in php
body: <p>I would like to ask, how to easily append new node to the end of found node in php.
  Lets say I have xml like this:</p>
  
  <pre><code>&lt;Root&gt;
      &lt;child id=1&gt;
          &lt;text&gt;smth&lt;/text&gt;
      &lt;/child&gt;
  &lt;/Root&gt;
  </code></pre>
  
  <p>I want to find the child element with id 1 and then append another node as last.
  I was trying to find an answer, but it either answer how to find it, or how to write into it, unfortunately I was not able to put it together.</p>
  
  <p>I would be really happy if someone can help me with this.</p>