title: How can we convert XML file to CSV using Java Code?
body: <p>I want to convert XML file to CSV using Java Code, i don't want to use XML Stylesheet(XSL) or XSLT. Here is my XML file.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;PickAndPlace&gt;
  &lt;Components&gt;
      &lt;Component id="1"&gt;
          &lt;X_Dimension&gt;4.33&lt;/X_Dimension&gt;
          &lt;Y_Dimension&gt;2.962&lt;/Y_Dimension&gt;
          &lt;Designation&gt;None&lt;/Designation&gt;
          &lt;Package&gt;None&lt;/Package&gt;
          &lt;Angle&gt;0&lt;/Angle&gt;
      &lt;/Component&gt;
      &lt;Component id="5"&gt;
          &lt;X_Dimension&gt;4.33&lt;/X_Dimension&gt;
          &lt;Y_Dimension&gt;8.692&lt;/Y_Dimension&gt;
          &lt;Designation&gt;None&lt;/Designation&gt;
          &lt;Package&gt;None&lt;/Package&gt;
          &lt;Angle&gt;0&lt;/Angle&gt;
      &lt;/Component&gt;
      &lt;Component id="9"&gt;
          &lt;X_Dimension&gt;4.33&lt;/X_Dimension&gt;
          &lt;Y_Dimension&gt;14.381&lt;/Y_Dimension&gt;
          &lt;Designation&gt;None&lt;/Designation&gt;
          &lt;Package&gt;None&lt;/Package&gt;
          &lt;Angle&gt;0&lt;/Angle&gt;
      &lt;/Component&gt;
  &lt;/Components&gt;
  &lt;/PickAndPlace&gt;
  </code></pre>
  
  <p>Here what i want as my CSV Output.</p>
  
  <pre><code>X_Dimension,Y_Dimension,Designation,Package,Angle,_id
  4.33,2.962,None,None,0,1
  4.33,8.692,None,None,0,5
  4.33,14.381,None,None,0,9
  </code></pre>