title: PHP SimpleXML, how to set attributes?
body: <p>if you've got something like,</p>
  
  <pre><code>&lt;hello id="1" name="myName1"&gt;
   &lt;anotherTag title="Hello"&gt;
   &lt;/anotherTag&gt;
  &lt;/hello&gt;
  &lt;hello id="2" name="myName2"&gt;
   &lt;anotherTag title="Hi"&gt;
   &lt;/anotherTag&gt;
  &lt;/hello&gt;
  </code></pre>
  
  <p>How to change the attributes of, for example, hello id 2, to name="William" ? Or the title hi to hello ?</p>
  
  <p>Thanks a lot for your atention,
  H'</p>