title: Select node based on attribute and change subnode
body: <p>I have following XML file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;programmedata&gt;
  &lt;programme id="1"&gt;
  &lt;name&gt;Left&lt;/name&gt;
  &lt;image_path&gt;&lt;/image_path&gt;
  &lt;rating_point&gt;0&lt;/rating_point&gt;
  &lt;five_star&gt;0&lt;/five_star&gt;
  </code></pre>
  
  <p>With following code I am trying to edit value of rating_point:</p>
  
  <pre><code>$xml=simplexml_load_file("content.xml");
  if(!empty($_POST["rating"]) &amp;&amp; !empty($_POST["voted_programme"])){
      try{
       $rating = $_POST["rating"];
          $i = $_POST['voted_programme'];
          $xml-&gt;programme[$i]-&gt;rating_point = $rating;
          if($rating == '5')
          {
              $xml-&gt;programme[$i]-&gt;five_star = $rating;
          }
  </code></pre>
  
  <p>but getting error:<br>
  <code>Notice: Indirect modification of overloaded element of SimpleXMLElement has no effect in ...</code> </p>
  
  <p>tried different solution but seems not working.</p>