title: Problems while transforming into a pandas dataframe the following xml elements?
body: <p>I am using beautiful soup for parsing and extracting some info from a bunch of xml files as follows:</p>
  
  <pre><code>import os
  a_lis = []
  for filepath in glob(os.path.join('../data/trainingFiles/', '*.xml')):
      with open(filepath) as f:
          content = f.read()
          results = BeautifulSoup(content, 'lxml')
          #print(results)
          for LabelInteractions in results.find_all("labelinteractions"):
              #print(LabelInteractions)
              for labelinteractions in LabelInteractions.findAll('labelinteraction'):
                  print(labelinteractions)
  </code></pre>
  
  <p>out:</p>
  
  <pre><code>&lt;labelinteraction precipitant="ritonavir" precipitantcode="N0000007423" type="Unspecified interaction"&gt;&lt;/labelinteraction&gt;
  &lt;labelinteraction precipitant="gc stimulator" precipitantcode="NO MAP" type="Unspecified interaction"&gt;&lt;/labelinteraction&gt;
  ....
  &lt;labelinteraction precipitant="riociguat" precipitantcode="N0000188995" type="Unspecified interaction"&gt;&lt;/labelinteraction&gt;
  &lt;labelinteraction effect=" 25064002: Headache (finding)" precipitant="alcohol" precipitantcode="N0000007432" type="Pharmacodynamic interaction"&gt;&lt;/labelinteraction&gt;
  </code></pre>
  
  <p>How can I transform those xml attributes into a pandas dataframe format?, the columns would look something like this:</p>
  
  <pre><code>precipitant  precipitantcode type effect
  </code></pre>