title: Need to retrieve all excel column names in a list with Java Code
body: <p>I need to get all the column names from the excel file and it could be either .xls or .xlsx with the help of java code.
  i will provide the file name and file directory as inputs and code need to read the file in the directory and capture all the columns in a list and send the output in xml format.</p>
  
  <p>the below is the sample xml data and will have more columns than below</p>
  
  <pre><code>Location ID Location Name   Product ID  Supplier Name   
  Invoice Number  Sales Qty   Buy Qty Inventory Qty
  
  2-LG2-344   ABC BBC CBC AK1234  5   4   3
  
  2-LG2-344   ABC CBC CBC AK1235  2   6   5
  
  2-LG2-344   ABC DBC CBC AK1236  3   2   3
  
  
  
  the output should be like 
  &lt;ptnr_label_names&gt;
  &lt;field_name&gt;Location ID&lt;field_name&gt;
  &lt;field_name&gt;Location Name&lt;field_name&gt;
  &lt;field_name&gt;Product ID&lt;field_name&gt;
  &lt;field_name&gt;Supplier Name&lt;field_name&gt;
  &lt;field_name&gt;Invoice Number&lt;field_name&gt;
  &lt;field_name&gt;Sales Qty&lt;field_name&gt;
  &lt;field_name&gt;Buy Qty&lt;field_name&gt;
  &lt;field_name&gt;Inventory Qty&lt;field_name&gt;
  &lt;/ptnr_label_names&gt;
  </code></pre>