title: Convert XML Response to Python Dataframe
body: <p><a href="http://stat.data.abs.gov.au/restsdmx/sdmx.ashx/GetDataStructure/all" rel="nofollow noreferrer">http://stat.data.abs.gov.au/restsdmx/sdmx.ashx/GetDataStructure/all</a></p>
  
  <p>From the above link we get list of Dataset available in <a href="http://www.abs.gov.au/" rel="nofollow noreferrer">http://www.abs.gov.au/</a></p>
  
  <p>I need to extract all Dataset Id &amp; names in English &amp; French</p>
  
  <p>KeyFamily id as "Dataset Id"</p>
  
  <p>Name xml:lang="en" as "Dataset Name English"</p>
  
  <p>Name xml:lang="fr" as "Dataset Name French"</p>
  
  <p>From the Table: "message:KeyFamilies"</p>
  
  <p>Source:</p>
  
  <p><a href="https://i.stack.imgur.com/LSF04.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LSF04.jpg" alt="enter image description here"></a></p>
  
  <p>Trying in below code:</p>
  
  <pre><code>import requests
  import pandas as pd
  import xml.etree.ElementTree as ET
  
  URL = 'http://stat.data.abs.gov.au/restsdmx/sdmx.ashx/GetDataStructure/all'
  
  print('\n&gt; Retrieving XML Data:', URL)
  XML_Data = requests.get(URL).content
  print('&gt;&gt; XML_Data:', len(XML_Data))
  
  def xml2df(XML_Data):
      root = ET.XML(XML_Data) # element tree
      all_records = []
      for i, child in enumerate(root):
      print(i)
      record = {}
      for subchild in child:
          record[subchild.tag] = subchild.text
      all_records.append(record)
      df = pd.DataFrame(all_records)
  
      return df
  
  df = xml2df(XML_Data)
  </code></pre>