title: How to parse a complicated XML with Python
body: <p>I am working on converting an XML file into a CSV or pandas file. There are various categories that are necessary and others which are unwanted in the XML. Is there an efficient method to pick out the information in the code as formatted below. This needs to be done on a relatively large scale >10,000 documents. For example, I want to get the "family-id", "data", and </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE patent-document\n  PUBLIC "-//MXW//DTD patent-document XML//EN" 
  "http://www.ir-facility.org/dtds/patents/v1.4/patent-document.dtd"&gt;
  &lt;patent-document ucid="US-20030137706-A1" country="US" doc- 
  number="20030137706" kind="A1" lang="EN" family-id="10973265" status="new" 
  date-produced="20090605" date="20030724"&gt;
    &lt;bibliographic-data&gt;
      &lt;publication-reference ucid="US-20030137706-A1" status="new" 
       fvid="76030147"&gt;
    &lt;document-id status="new" format="original"&gt;
      &lt;country&gt;US&lt;/country&gt;
      &lt;doc-number&gt;20030137706&lt;/doc-number&gt;
      &lt;kind&gt;A1&lt;/kind&gt;
      &lt;date&gt;20030724&lt;/date&gt;
    &lt;/document-id&gt;
  &lt;/publication-reference&gt;
  &lt;application-reference ucid="US-18203002-A" status="new" is-representative="NO"&gt;
    &lt;document-id status="new" format="epo"&gt;
      &lt;country&gt;US&lt;/country&gt;
      &lt;doc-number&gt;18203002&lt;/doc-number&gt;
      &lt;kind&gt;A&lt;/kind&gt;
      &lt;date&gt;20021204&lt;/date&gt;
    &lt;/document-id&gt;
  &lt;/application-reference&gt;
  &lt;priority-claims status="new"&gt;
    &lt;priority-claim ucid="HU-0000532-A" status="new"&gt;
      &lt;document-id status="new" format="epo"&gt;
        &lt;country&gt;HU&lt;/country&gt;
        &lt;doc-number&gt;0000532&lt;/doc-number&gt;
        &lt;kind&gt;A&lt;/kind&gt;
        &lt;date&gt;20000207&lt;/date&gt;
      &lt;/document-id&gt;
    &lt;/priority-claim&gt;
    &lt;priority-claim ucid="HU-0100016-W" status="new"&gt;
    &lt;/abstract&gt;
    &lt;description load-source="us" status="new" lang="EN"&gt;
       &lt;heading&gt;TECHNICAL FIELD &lt;/heading&gt;
       &lt;p&gt;[0001] The object of the invention is a method for the holographic 
       recording of data. In the method a hologram containing the date is 
       recorded in a waveguide layer as an interference between an object beam 
       and a reference beam. The object beam is essentially perpendicular to 
       the plane of the hologram, while the reference beam is coupled in the 
       waveguide. There is also proposed an apparatus for performing the 
       method. The apparatus comprises a data storage medium with a waveguide 
       holographic storage layer, and an optical system for writing and reading 
       the holograms. The optical system comprises means for producing an 
       object beam and a reference beam, and imaging the object beam and a 
       reference beam on the storage medium. &lt;/p&gt;
       &lt;heading&gt;BACKGROUND ART &lt;/heading&gt;
        &lt;p&gt;[0002] Storage systems realised with tapes stand out from other data 
        storage systems regarding their immense storage capacity. Such systems 
        were used to realise the storage of data in the order of Terabytes. 
        This large storage capacity is achieved partly by the storage density, 
        and partly by the length of the storage tapes. The relative space 
        requirements of tapes are small, because they may be wound up into a 
        very small volume. Their disadvantage is the relatively large random 
        access time. &lt;/p&gt;
  </code></pre>