title: Modify XML Configuration if Condition is Met - Ansible
body: <p>Hi I am new to ansible and I have to write a script for deployment where an artifact will be dropped in a folder and it's package is referenced from an XML config file. I am able to do the first part and it works just fine but the second part is challenging me where I have to edit the conf file and add a child element there. It is written like this:</p>
  
  <pre><code>- name: Configure Artifact Properties
  - xml:
      path: '{{ server_home }}/conf.xml'
      xpath: /Server/SupportedArtifactTypes
      add_children:
        - NewArtifact
            ArtifactName: HelloWorld
            ArtifactPackage: org.HelloWorld
  </code></pre>
  
  <p>Now this will work fine the first time but when I am going to rerun it in the next deployment cycle, its going to add the child element again which should not be happening. Does anybody have a clue how can we modify the task so that the configuration is added only if it does not exist?</p>