title: How to edit an XML file in Python?
body: <p>I have a resx file that uses XML with a bunch of data that looks like this:</p>
  
  <pre><code>&lt;data name="key_first" xml:space="preserve"&gt;
      &lt;value&gt;Text 1&lt;/value&gt;
  &lt;/data&gt;
  &lt;data name="key_second" xml:space="preserve"&gt;
      &lt;value&gt;Text 2&lt;/value&gt;
  &lt;/data&gt;
  &lt;data name="key_third" xml:space="preserve"&gt;
      &lt;value&gt;Text 3&lt;/value&gt;
  &lt;/data&gt;
  </code></pre>
  
  <p>where the name values all share a word (eg: "key"). What I wanted to do in Python was take this 'data' name value ("key+anything that follows") and add it to the 'value' text, and then save the new file but I'm very new to the XML/Python world and I'm kind of lost. I want it to look something like this:</p>
  
  <pre><code>&lt;data name="key_first" xml:space="preserve"&gt;
      &lt;value&gt;[key_first] Text 1&lt;/value&gt;
  &lt;/data&gt;
  &lt;data name="key_second" xml:space="preserve"&gt;
      &lt;value&gt;[key_second] Text 2&lt;/value&gt;
  &lt;/data&gt;
  &lt;data name="key_third" xml:space="preserve"&gt;
      &lt;value&gt;[key_third] Text 3&lt;/value&gt;
  &lt;/data&gt;
  </code></pre>
  
  <p>How do I do this? Should I use minidom or Element Tree?</p>