title: find xml element based on its attribute and change its value
body: <p>I am using python xmlElementTree and want to assign or modify a xml element value based on its attribute. Can somebody give me an idea how to do this?</p>
  
  <p>For example: Here is a xml file and I need to set the value for the element "number" based on the attribute "sys/phoneNumber/1", "sys2/SMSnumber/1" and so on.</p>
  
  <pre><code>&lt;root&gt;
      &lt;phoneNumbers&gt;
          &lt;number topic="sys/phoneNumber/1" update="none" /&gt;
          &lt;number topic="sys/phoneNumber/2" update="none" /&gt;
          &lt;number topic="sys/phoneNumber/3" update="none" /&gt;
      &lt;/phoneNumbers&gt;
  
      &lt;gfenSMSnumbers&gt;
          &lt;number topic="sys2/SMSnumber/1" update="none" /&gt;
          &lt;number topic="sys2/SMSnumber/2" update="none" /&gt;
      &lt;/gfenSMSnumbers&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>edit: Added closure for the tag root in the XML file.</p>