title: Parse xbrl file in python
body: <p>I am working on a xml parser. 
  The goal is to parse a number of different xml files <strong>where prefixes and tags remain consistent but namespaces change</strong>.</p>
  
  <p>I am hence trying either:</p>
  
  <ul>
  <li>to parse the xml just by <code>&lt;prefix:tags&gt;</code> without resolving (replacing) the prefix with the namespace. The prefixes remain unchanged from document to document.</li>
  <li>to load automatically the namespaces so that the identifier (<code>&lt;prefix:tag&gt;</code>) could be replaced with the proper namespace. </li>
  <li>just parse the xml by tag</li>
  </ul>
  
  <p>I have tried with <code>xml.etree.ElementTree</code>. </p>
  
  <p>I also had a look at <a href="http://lxml.de/tutorial.html#namespaces" rel="nofollow noreferrer"><code>lxml</code></a>
  I did not find any configuration option of the <a href="http://lxml.de/parsing.html" rel="nofollow noreferrer">XMLParser</a> in lxml that could help me out although <a href="https://stackoverflow.com/questions/14853243/parsing-xml-with-namespace-in-python-elementtree">here</a> I could read an answer where the author suggests that <code>lxml</code> should be able to collect namespaces for me automatically.</p>
  
  <p>Interestingly, <code>parsed_file = etree.XML(file)</code> fails with the error:</p>
  
  <pre><code>lxml.etree.XMLSyntaxError: Start tag expected, '&lt;' not found, line 1, column 1
  </code></pre>
  
  <p>One example of the files I would like to parse is <a href="http://edgar.sec.gov/Archives/edgar/data/1267097/000104746914000925/trw-20131231.xml" rel="nofollow noreferrer">here</a></p>