title: How to parse multiple xml files inside a zip file containing multiple subdirectories
body: <p>I have to search and print the results from multiple XML files stored in a zip file.
  My code works pretty well in that case. But when the zip file contains multiple subdirctories and inside that XML files it shows</p>
  <blockquote>
  <p>File &quot;/usr/lib/python3.10/xml/etree/ElementTree.py&quot;, line 1348, in XML
  return parser.close()
  xml.etree.ElementTree.ParseError: no element found: line 1, column 0</p>
  </blockquote>
  <p>Here is my code (it works well if all the XML files are stored inside zip file without any folders)</p>
  <pre class="lang-py prettyprint-override"><code>import re
  import xml.etree.ElementTree as ET
  from zipfile import ZipFile
  
  from utils.xml import SRXMLElements
  
  DEFAULT_ZIP = &quot;./resources/another.zip&quot;
  
  
  def parse_xml(search_pattern) -&gt; None:
      with ZipFile(DEFAULT_ZIP, &quot;r&quot;) as my_zip:
          for file_name in my_zip.namelist():
              with my_zip.open(file_name) as my_file:
                  root = ET.fromstring(my_file.read().decode())
                  for billSummary in root.iter(SRXMLElements.BillSummaries.value):
                      for text in billSummary.iter(SRXMLElements.Text.value):
                          summary_text = text.text
                          for match in search_pattern.finditer(summary_text):
                              print(text.text)
                              for child in billSummary.iter('RECEIVEDDATE'):
                                  print(child.text)
                              
  
  
  def main() -&gt; None:
     
      
      search_pattern = re.compile(&quot;1941012339&quot;)
      parse_xml(search_pattern)
    
  
  
  if __name__ == &quot;__main__&quot;:
      main()
  </code></pre>
  <pre class="lang-py prettyprint-override"><code>from enum import Enum
  
  
  class SRXMLElements(Enum):
      BillSummaries = &quot;Product&quot;
      Text = &quot;SERVICETAGNUM&quot;
  
  
  </code></pre>