title: XML to CSV : a native way to create flat files?
body: <p>There is a lot of questions about XML to CSV conversion but mine is quite precise so I ask it here. </p>
  
  <p>I threat inventories and get XML files like :</p>
  
  <pre><code>&lt;item&gt;
     &lt;sku&gt;abc&lt;/sku&gt;
     &lt;title&gt;un livre&lt;/title&gt;
     &lt;price&gt;42&lt;/price&gt;
     &lt;attributes&gt;
        &lt;attribute&gt;
            &lt;name&gt;Nombre de pages&lt;/name&gt;
            &lt;value&gt;123&lt;/value&gt;
        &lt;/attribute&gt;
        &lt;attribute&gt;
            &lt;name&gt;Auteur&lt;/name&gt;
            &lt;value&gt;bob la mouche&lt;/value&gt;
        &lt;/attribute&gt;
     &lt;/attributes&gt;
     &lt;contributors&gt;
        &lt;contributor&gt;toto&lt;/contributor&gt;
        &lt;contributor&gt;titi&lt;/contributor&gt;
        &lt;contributor&gt;tata&lt;/contributor&gt;
     &lt;/contributors&gt;
  &lt;/item&gt;
  </code></pre>
  
  <p>I need to convert it to a 2D format. I would like to use a quite known format like array/object disposition, columns would look like :</p>
  
  <pre><code>sku
  title
  price
  attributes.attribute[0].name
  attributes.attribute[0].value
  attributes.attribute[1].name
  attributes.attribute[1].value
  contributors.contributor[0]
  contributors.contributor[1]
  contributors.contributor[2]
  </code></pre>
  
  <p>If there is no direct answer, do not code it for me, I know how to make it and will be pleased to share it to you. But that's just to know if there is a direct way (such as using very exotic XML methods existing somewhere on a xml parsing lib).</p>
  
  <p>Thanks</p>