title: How to read XML file into Pandas Dataframe like Read XML Table in Excel
body: <p>I have an xml file and I am trying to iterate through the tags to convert it to a pandas dataframe. My current process is to open the XML file with excel as an "XML table" but this takes forever. Trying to find a similar process in Python.</p>
  
  <p>I am trying to follow along with the code presented on numerous other Stack Overflow questions and articles such as here <a href="https://intellipaat.com/community/42421/python-xml-file-to-pandas-dataframe" rel="nofollow noreferrer">here</a> and <a href="https://stackoverflow.com/questions/28259301/how-to-convert-an-xml-file-to-nice-pandas-dataframe">here</a></p>
  
  <p>I believe there are 2 problems I am facing:</p>
  
  <ol>
  <li><p>Does having the namespace affect my xml?</p></li>
  <li><p>I don't want to specify all of my tags as seen as a solution in 19.7.1.6. of the Element Tree documentation. I just want all of my tags to appear as a column for each "Security." If it doesn't have that tag it should be null. I also do not want to do a nasty if-else. </p></li>
  </ol>
  
  <p>The problem is that when I run the code:</p>
  
  <pre><code>import xml.etree.ElementTree as et
  
  etree = et.parse(xml_path)
  test = etree.getroot()
  </code></pre>
  
  <p>and try and iterate as suggested in the above links, I am not able to easily access the child nodes.</p>
  
  <p>Sample File:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;SecurityInformation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tempuri.org/SecurityInformation.xsd"&gt;
      &lt;Security&gt;
          &lt;Country&gt;United States&lt;/Country&gt;
      &lt;/Security&gt;
  &lt;/SecurityInformation&gt; 
  </code></pre>