title: How to replace values in a tag for a batch of xml files using python
body: <p>I have around 900 xml files in the format given below:</p>
  <pre><code>&lt;annotation&gt;
  &lt;folder&gt;EMap&lt;/folder&gt;
  &lt;filename&gt;EricMap-lm005.jpg&lt;/filename&gt;
  &lt;path&gt;C:\Ashwij\EMap\EricMap-lm005.jpg&lt;/path&gt;
  &lt;object&gt;
      &lt;name&gt;GreenHose&lt;/name&gt;
      &lt;bndbox&gt;
          &lt;xmin&gt;376&lt;/xmin&gt;
      &lt;/bndbox&gt;
  &lt;/object&gt;
  &lt;/annotation&gt;
  </code></pre>
  <p>The numbers in <code>&lt;bndbox&gt;</code> are different for different xml files.
  I have a list of values, say <code>lis = [1, 2, 3, 4, ......]</code>
  I am trying to write a python code to replace the values in <code>&lt;bndbox&gt;</code> with values in the list.</p>
  <p>So far I have tried</p>
  <pre><code>from bs4 import BeautifulSoup
  
  with open('EricMap-lm005.xml', 'r') as f:
      data = f.read()
   
  bs_data = BeautifulSoup(data, 'xml')
  
  for tag in bs_data.find_all('object', {'bndbox'}):
      tag['xmin'] = &quot;100&quot;
     
  print(bs_data.prettify())
  </code></pre>
  <p>But this is only for one xml file and one value. Is there a way to parse a list through the <code>&lt;xmin&gt;</code> tag for different xml files?</p>