title: Convert XML to other format?
body: <p>What is the simplest way to parse the following XML?</p>
  
  <pre><code>&lt;Fruit&gt;
    &lt;FruitId&gt;Bannana&lt;/FruitId&gt;
    &lt;FruitColor&gt;Yellow&lt;/FruitColor&gt;
    &lt;FruitShape&gt;Moon&lt;/FruitShape&gt;
    &lt;Customer&gt;
       &lt;Name&gt;Joe&lt;/Name&gt;
       &lt;Numbereaten&gt;5&lt;/NumberEaten&gt;
       &lt;Weight&gt;2.6&lt;/Weight&gt;
    &lt;/Customer&gt;
    &lt;Customer&gt;
       &lt;Name&gt;Mark&lt;/Name&gt;
       &lt;Numbereaten&gt;8&lt;/NumberEaten&gt;
       &lt;Weight&gt;5.0&lt;/Weight&gt;
    &lt;/Customer&gt;
  &lt;/Fruit&gt;
  &lt;Fruit&gt;
  </code></pre>
  
  <p>.....</p>
  
  <p>Assuming I have an XML file with multiple  and I wanted to extract information such that I can make a csv corresponding to only specific fields (Fruit Id) and all (NUmber eaten and weight pairs, excluding the customer name) How would I accomplish this? Ideally I want to be able to get some data structure or csv that represents the following:</p>
  
  <pre><code>Bannana, 5, 2.6
  Bannana, 8, 5
  ...
  Apple 6, 5
  Apple 3, 2
  </code></pre>
  
  <p>I know there is DOMParser and SAXParser for Java, but am wondering if other languages or other means to easily get this information is now available in this day and age now that were in 2013 to simplify this. Or maybe even be able to capture the data in some dictionary data structure that contians some:</p>
  
  <pre><code>Bannana: [5,2.6], [8,5]
  </code></pre>
  
  <p>Such that it is easily organized in a way thats programatically iteratable and extracted.</p>