title: Editing and inserting new attributes into XML files based on value of existing attribute
body: <p>I have an XML file structured like this:
  All examples I have read shows inserting node but not as described below.</p>
  
  <pre><code>&lt;asset&gt;
           &lt;vehicle inUse="true"&gt;
              &lt;type&gt;sedan&lt;/type&gt;
              &lt;model&gt;735i&lt;/model&gt;
              &lt;make&gt;BMW&lt;/make&gt;
              &lt;year&gt;2017&lt;/year&gt;
            &lt;/vehicle&gt;
  
           &lt;vehicle inUse="true"&gt;
              &lt;type&gt;sedan&lt;/type&gt;
              &lt;model&gt;735i&lt;/model&gt;
              &lt;make&gt;BMW&lt;/make&gt;
              &lt;year&gt;2016&lt;/year&gt;
            &lt;/vehicle&gt;
  &lt;/asset&gt;
  </code></pre>
  
  <p>I would like to do a batch edit and insert a new vehicle node after an existing vehicle node with the highest year value. So after 2017</p>
  
  <p>For example the code above will end up like this:</p>
  
  <pre><code>&lt;asset&gt;
           &lt;vehicle inUse="true"&gt;
              &lt;type&gt;sedan&lt;/type&gt;
              &lt;model&gt;735i&lt;/model&gt;
              &lt;make&gt;BMW&lt;/make&gt;
              &lt;year&gt;2017&lt;/year&gt;
            &lt;/vehicle&gt;
  
  &lt;!-- new node here--&gt;
  
           &lt;vehicle inUse="true"&gt;
              &lt;type&gt;sedan&lt;/type&gt;
              &lt;model&gt;735i&lt;/model&gt;
              &lt;make&gt;BMW&lt;/make&gt;
              &lt;year&gt;2010&lt;/year&gt;
            &lt;/vehicle&gt;
  
           &lt;vehicle inUse="true"&gt;
              &lt;type&gt;sedan&lt;/type&gt;
              &lt;model&gt;735i&lt;/model&gt;
              &lt;make&gt;BMW&lt;/make&gt;
              &lt;year&gt;2016&lt;/year&gt;
            &lt;/vehicle&gt;
  &lt;/asset&gt;
  </code></pre>