title: Modify XML attribute PHP DOM
body: <p>I have an XML file that looks like this.</p>
  
  <pre><code>&lt;collections id="my collections"&gt;
   &lt;category id="my category"&gt;
     &lt;record id="my record"&gt;
       &lt;title&gt;Some Info&lt;/title&gt;
     &lt;/record&gt;
   &lt;/category&gt;
  &lt;/collections&gt;
  </code></pre>
  
  <p>I am looking for away to replace any attribute in the above XML file with a new attribute,Using PHP DOM and Xpath.
  Any help is highly appreciated</p>