title: How could I convert a simple XML to CSV using Python?
body: <p>This is my XML file <code>test.xml</code>:</p>
  
  <pre><code>&lt;nodes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/nodes_file.xsd"&gt;
      &lt;node id="0" x="0.0" y="0.0" type="traffic_light"/&gt; 
      &lt;node id="1" x="0.0" y="500.0" type="priority"/&gt; 
      &lt;node id="2" x="500.0" y="0.0" type="priority"/&gt; 
      &lt;node id="3" x="0.0" y="-500.0" type="priority"/&gt;
      &lt;node id="4" x="-500.0" y="0.0" type="priority"/&gt;
  
  &lt;/nodes&gt;
  </code></pre>
  
  <p>I want to convert it to a CSV file which contains the following columns:
  <code>id, x, y, type</code>. So it would be something like this:</p>
  
  <pre><code>id,x,y,type
  0,0.0,0.0,traffic_light
  1,0.0,500.0,priority
  2,500.0,0.0,priority
  3,0.0,-500.0,priority
  4,-500.0,0.0,priority
  </code></pre>
  
  <p>How could I do it via Python? Thanks for your attention!</p>