title: Converting complex XML file to Pandas dataframe/CSV - Python
body: <p>I'm currently in the middle of converting a complex XML file to csv or pandas df.
  I have zero experience with xml data format and all the code suggestions I found online are just not working for me. Can anyone kindly help me with this? </p>
  
  <p>There are lots of elements in the data that I do not need so I won't include those here.</p>
  
  <p>For privacy reasons I won't be uploading the original data here but I'll be sharing what the structure looks like. </p>
  
  <pre><code>&lt;RefData&gt;
    &lt;Attributes&gt;
      &lt;Id&gt;1011&lt;/Id&gt;
      &lt;FullName&gt;xxxx&lt;/FullName&gt;
      &lt;ShortName&gt;xx&lt;/ShortName&gt;
      &lt;Country&gt;UK&lt;/Country&gt;
      &lt;Currency&gt;GBP&lt;/Currency&gt;
    &lt;/Attributes&gt;
    &lt;PolicyID&gt;000&lt;/PolicyID&gt;
    &lt;TradeDetails&gt;
      &lt;UniqueTradeId&gt;000&lt;/UniqueTradeId&gt;
      &lt;Booking&gt;UK&lt;/Booking&gt;
      &lt;Date&gt;12/2/2019&lt;/Date&gt;
      &lt;/TradeDetails&gt;
  &lt;/RefData&gt;
  &lt;RefData&gt;
    &lt;Attributes&gt;
      &lt;Id&gt;1012&lt;/Id&gt;
      &lt;FullName&gt;xxx2&lt;/FullName&gt;
      &lt;ShortName&gt;x2&lt;/ShortName&gt;
      &lt;Country&gt;UK&lt;/Country&gt;
      &lt;Currency&gt;GBP&lt;/Currency&gt;
    &lt;/Attributes&gt;
    &lt;PolicyID&gt;002&lt;/PolicyID&gt;
    &lt;TradeDetails&gt;
      &lt;UniqueTradeId&gt;0022&lt;/UniqueTradeId&gt;
      &lt;Booking&gt;UK&lt;/Booking&gt;
      &lt;Date&gt;12/3/2019&lt;/Date&gt;
      &lt;/TradeDetails&gt;
  &lt;/RefData&gt;
  </code></pre>
  
  <p>I would be needing everything in the  tag.</p>
  
  <p>Ideally I want the headers and output to look like this:</p>
  
  <p><a href="https://i.stack.imgur.com/Z4A9E.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Z4A9E.png" alt="enter image description here"></a></p>
  
  <p>I would sincerely appreciate any help I can get on this. Thanks a mil.</p>