title: Subract a fixed amount from values in multiple XML files
body: <p>I'm currently working on image labeling for multiple files and the labels are saved in XML. Turns out all the labels need to be shortened in height as the details in the upper part of the label are similar to other unrelated pictures. Therefore, I would like to subtract the value of all  <code>&lt;ymax&gt;(number)&lt;/ymax&gt;</code> in all of the XML files by a certain value. Is there a way to do this using notepad++ or python?</p>
  
  <p>Below is an example of a full XML file. All of the files have the same format. </p>
  
  <pre><code>&lt;annotation&gt;
      &lt;folder&gt;01&lt;/folder&gt;
      &lt;filename&gt;S249.jpeg&lt;/filename&gt;
      &lt;path&gt;D:\databs\01\01\S249.jpeg&lt;/path&gt;
      &lt;source&gt;
          &lt;database&gt;Unknown&lt;/database&gt;
      &lt;/source&gt;
      &lt;size&gt;
          &lt;width&gt;375&lt;/width&gt;
          &lt;height&gt;500&lt;/height&gt;
          &lt;depth&gt;3&lt;/depth&gt;
      &lt;/size&gt;
      &lt;segmented&gt;0&lt;/segmented&gt;
      &lt;object&gt;
          &lt;name&gt;A&lt;/name&gt;
          &lt;pose&gt;Unspecified&lt;/pose&gt;
          &lt;truncated&gt;0&lt;/truncated&gt;
          &lt;difficult&gt;0&lt;/difficult&gt;
          &lt;bndbox&gt;
              &lt;xmin&gt;116&lt;/xmin&gt;
              &lt;ymin&gt;280&lt;/ymin&gt;
              &lt;xmax&gt;141&lt;/xmax&gt;
              &lt;ymax&gt;325&lt;/ymax&gt;
          &lt;/bndbox&gt;
      &lt;/object&gt;
      &lt;object&gt;
          &lt;name&gt;A&lt;/name&gt;
          &lt;pose&gt;Unspecified&lt;/pose&gt;
          &lt;truncated&gt;0&lt;/truncated&gt;
          &lt;difficult&gt;0&lt;/difficult&gt;
          &lt;bndbox&gt;
              &lt;xmin&gt;143&lt;/xmin&gt;
              &lt;ymin&gt;280&lt;/ymin&gt;
              &lt;xmax&gt;169&lt;/xmax&gt;
              &lt;ymax&gt;324&lt;/ymax&gt;
          &lt;/bndbox&gt;
      &lt;/object&gt;
      &lt;object&gt;
          &lt;name&gt;A&lt;/name&gt;
          &lt;pose&gt;Unspecified&lt;/pose&gt;
          &lt;truncated&gt;0&lt;/truncated&gt;
          &lt;difficult&gt;0&lt;/difficult&gt;
          &lt;bndbox&gt;
              &lt;xmin&gt;169&lt;/xmin&gt;
              &lt;ymin&gt;280&lt;/ymin&gt;
              &lt;xmax&gt;195&lt;/xmax&gt;
              &lt;ymax&gt;324&lt;/ymax&gt;
          &lt;/bndbox&gt;
      &lt;/object&gt;
      &lt;object&gt;
          &lt;name&gt;A&lt;/name&gt;
          &lt;pose&gt;Unspecified&lt;/pose&gt;
          &lt;truncated&gt;0&lt;/truncated&gt;
          &lt;difficult&gt;0&lt;/difficult&gt;
          &lt;bndbox&gt;
              &lt;xmin&gt;220&lt;/xmin&gt;
              &lt;ymin&gt;280&lt;/ymin&gt;
              &lt;xmax&gt;241&lt;/xmax&gt;
              &lt;ymax&gt;324&lt;/ymax&gt;
          &lt;/bndbox&gt;
      &lt;/object&gt;
      &lt;object&gt;
          &lt;name&gt;B&lt;/name&gt;
          &lt;pose&gt;Unspecified&lt;/pose&gt;
          &lt;truncated&gt;0&lt;/truncated&gt;
          &lt;difficult&gt;0&lt;/difficult&gt;
          &lt;bndbox&gt;
              &lt;xmin&gt;206&lt;/xmin&gt;
              &lt;ymin&gt;396&lt;/ymin&gt;
              &lt;xmax&gt;229&lt;/xmax&gt;
              &lt;ymax&gt;431&lt;/ymax&gt;
          &lt;/bndbox&gt;
      &lt;/object&gt;
      &lt;object&gt;
          &lt;name&gt;B&lt;/name&gt;
          &lt;pose&gt;Unspecified&lt;/pose&gt;
          &lt;truncated&gt;0&lt;/truncated&gt;
          &lt;difficult&gt;0&lt;/difficult&gt;
          &lt;bndbox&gt;
              &lt;xmin&gt;230&lt;/xmin&gt;
              &lt;ymin&gt;396&lt;/ymin&gt;
              &lt;xmax&gt;260&lt;/xmax&gt;
              &lt;ymax&gt;428&lt;/ymax&gt;
          &lt;/bndbox&gt;
      &lt;/object&gt;
      &lt;object&gt;
          &lt;name&gt;B&lt;/name&gt;
          &lt;pose&gt;Unspecified&lt;/pose&gt;
          &lt;truncated&gt;0&lt;/truncated&gt;
          &lt;difficult&gt;0&lt;/difficult&gt;
          &lt;bndbox&gt;
              &lt;xmin&gt;261&lt;/xmin&gt;
              &lt;ymin&gt;391&lt;/ymin&gt;
              &lt;xmax&gt;285&lt;/xmax&gt;
              &lt;ymax&gt;428&lt;/ymax&gt;
          &lt;/bndbox&gt;
      &lt;/object&gt;
  &lt;/annotation&gt;
  </code></pre>