title: Creating DataFrame from XML document
body: <p>I understand this question has been asked a few times but I've tried everything to no avail. I'm not sure if this is an edge case or I'm missing something. I'm trying to parse an xml file and return as a df. Below is my attempt:</p>
  
  <pre><code>import xml.etree.ElementTree as ET
  import pandas as pd
  from lxml import objectify
  tree = ET.parse('file.xml')
  root = tree.getroot()
  
    &lt;?xml version="1.0"?&gt;
   -&lt;document page-count="1"&gt;
      -&lt;page number="1"&gt;
         -&lt;table data-table="1" data-page="1" data-filename="Schedule.pdf"&gt;
             -&lt;tr&gt;
                  &lt;td colspan="17"&gt;Wednesday 20th Mar&lt;/td&gt;
             -&lt;/tr&gt;
             -&lt;tr&gt;
                  &lt;td colspan="3" style="text-align: right"&gt;1&lt;/td&gt;
                  &lt;td style="text-align: right"&gt;2&lt;/td&gt;
                  &lt;td style="text-align: right"&gt;3&lt;/td&gt;
                  &lt;td style="text-align: right"&gt;4&lt;/td&gt;
                  &lt;td style="text-align: right"&gt;5&lt;/td&gt;
                  &lt;td style="text-align: right"&gt;6&lt;/td&gt;
                  &lt;td style="text-align: right"&gt;7&lt;/td&gt;
                  &lt;td style="text-align: right"&gt;8&lt;/td&gt;
                  &lt;td style="text-align: right"&gt;9&lt;/td&gt;
                  &lt;td style="text-align: right"&gt;10&lt;/td&gt;
                  &lt;td style="text-align: right"&gt;11&lt;/td&gt;
                  &lt;td style="text-align: right"&gt;12&lt;/td&gt;
                  &lt;td style="text-align: right"&gt;13&lt;/td&gt;
                  &lt;td style="text-align: right"&gt;14&lt;/td&gt;
                  &lt;td style="text-align: right"&gt;15&lt;/td&gt;
              &lt;/tr&gt;
             -&lt;tr&gt;
                  &lt;td&gt;HOME&lt;/td&gt;
                  &lt;td&gt;D&lt;/td&gt;
                  &lt;td/&gt;
                  &lt;td/&gt;
                  &lt;td&gt;08:00&lt;/td&gt;
                  &lt;td&gt;09:00&lt;/td&gt;
                  &lt;td&gt;10:00&lt;/td&gt;
                  &lt;td&gt;11:00&lt;/td&gt;
                  &lt;td&gt;12:00&lt;/td&gt;
                  &lt;td&gt;13:00&lt;/td&gt;
                  &lt;td/&gt;
                  &lt;td/&gt;
                  &lt;td/&gt;
                  &lt;td colspan="4"/&gt;
              &lt;/tr&gt;            
          &lt;/table&gt;
       &lt;/page&gt;
    &lt;/document&gt;
  </code></pre>
  
  <p>I can export the data as strings:</p>
  
  <pre><code>print(ET.tostring(root, encoding='utf8').decode('utf8'))
  </code></pre>
  
  <p>But when trying to export as a df it returns an empty frame:</p>
  
  <pre><code>xml = objectify.parse('file.xml')
  root = xml.getroot()
  
  data=[]
  for i in range(len(root.getchildren())):
      data.append([child.text for child in root.getchildren()[i].getchildren()])
  
  df = pd.DataFrame(data).T
  </code></pre>
  
  <p>Out:</p>
  
  <pre><code>      0
  0  None
  </code></pre>
  
  <p>If the date is stripped I'm hoping to Intended Output will be:</p>
  
  <pre><code>         1      2      3      4      5      6      7      8 9 10 11 12 13 14 15
  0  HOME  D      08:00  09:00  10:00  11:00  12:00  13:00                    
  </code></pre>