title: Ansible edit multiple attributes with same name in XML file
body: <p>I am attempting to edit configuration files for various servers using Ansible and have run into an XML document that has multiple attributes with the same name where the value needs to be adjusted depending on the server state. The config file shrunken down looks like this:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  
  &lt;Document&gt;
    &lt;properties&gt;
      &lt;property name=&quot;daily.backup.filename&quot;&gt;test.data.thin&lt;/property&gt;
      &lt;property name=&quot;admin.ui.allow.manual.backup.download&quot;&gt;false&lt;/property&gt;
      &lt;property name=&quot;admin.ui.allow&quot;&gt;false&lt;/property&gt;
    &lt;/properties&gt;
  &lt;/Document&gt;
  </code></pre>
  <p>This config file would have over 50 properties with different names.  My aim is to adjust the data within that single property without using lineinfile module.</p>
  <p>Currently, I am able to read the specific value I need but the value will change if the order changes.</p>
  <pre><code>- hosts: localhost
  
    tasks:
    - name: Read an element's attribute values
      xml:
        path: /tmp/test.xml
        xpath: /Document/properties/property
        content: text
      register: xmlresp
  
    - name: Show an attribute value
      debug:
        var: xmlresp.matches[2]
  </code></pre>
  <p>Now I just need to be able to write new information for the &quot;admin.ui.allow.manual.backup.download&quot; property. Like changing the content to &quot;true&quot; or &quot;True&quot;</p>