title: XML to XLSX and vice versa using java
body: <p>I have to complete this task: I'm given a xml file which is exported from an application, I need to make an xlsx file out of it containing table hierarchy make changes to the xlsx file using excel then make it back to xml having all these changes. All this using Java. I'm aware of apache poi library. For xlsx you have to use XSSF instead of HSSF. I checked out their examples manipulating excel but I'm struggling around one point. Examples in the official poi websites are showing how to create xlsx file containing tables, cells containing various data but where goes the XML part and reading of XML file? I need xlsx file to look according to XML.</p>
  
  <p>Any help or pointers into right direction would be greatly appreciated.</p>
  
  <p>My XML example file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;data type="data"&gt;
  
    &lt;title&gt;Duomenų suvedimo formos pavadinimas&lt;/title&gt;
  
    &lt;fields&gt;
      &lt;item id="org" label="Institucija/Įstaiga" valueField="orgId" labelField="orgLabel" tooltipField="orgTooltip" type="dim" /&gt;
  
      &lt;item id="R1" label="R1 pavadinimas" group="Katalogo pavadinimas" valueField="value1" type="value" inputEnabled="1" valueType="numeric"/&gt;
      &lt;item id="R2" label="R2 pavadinimas" group="Katalogo pavadinimas" valueField="value2" type="value" inputEnabled="1" valueType="numeric"/&gt;
      &lt;item id="R3" label="R3 išvestinis" group="Katalogo pavadinimas" valueField="value3" type="value" inputEnabled="0" valueType="numeric" formula="[R1]/12 + [R2]"/&gt;
    &lt;/fields&gt;
  
    &lt;dataItems&gt;
      &lt;item orgId="ins1" orgLabel="Institucija 1" orgTooltip="Institucija 1" grp="2" value1="10" value2="20" value3="" isval="1" edit="1" /&gt;
      &lt;item orgId="ins2" orgLabel="Institucija 2" orgTooltip="Institucija 2" grp="3" value1="15" value2="25" value3="" isval="1" edit="1" /&gt;
    &lt;/dataItems&gt;
  
  &lt;/data&gt;
  </code></pre>