Parse xml using Java
<p>Please help me to parse the following xml using Java</p>

<p>I need to get the "Total Contract Value (Gross NBA)" row values for 3 columns. I tried with Document Builder and SAXParser, as the format is confusing, please help me to get it fixed</p>

<pre><code>&lt;?xml version='1.0'?&gt;
&lt;?mso-application progid='Excel.Sheet'?&gt;
&lt;s:Workbook xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:s="urn:schemas-microsoft-com:office:spreadsheet"&gt;
  &lt;s:Styles&gt;
    &lt;s:Style s:ID="REGULAR"&gt;
      &lt;s:Alignment s:WrapText="1" /&gt;
      &lt;s:Font s:FontName="Arial" s:Color="#000000" /&gt;
    &lt;/s:Style&gt;
    &lt;s:Style s:ID="BOLD"&gt;
      &lt;s:Alignment s:Vertical="Bottom" s:WrapText="1" /&gt;
      &lt;s:Font s:Bold="1" s:FontName="Arial" s:Color="#000000" /&gt;
    &lt;/s:Style&gt;
    &lt;s:Style s:ID="REGULAR_NO_WRAP"&gt;
      &lt;s:Alignment /&gt;
      &lt;s:Font s:FontName="Arial" s:Color="#000000" /&gt;
    &lt;/s:Style&gt;
    &lt;s:Style s:ID="DATE"&gt;
      &lt;s:Font s:FontName="Arial" s:Color="#000000" /&gt;
      &lt;s:NumberFormat s:Format="Short Date" /&gt;
    &lt;/s:Style&gt;
    &lt;s:Style s:ID="LINK"&gt;
      &lt;s:Alignment /&gt;
      &lt;s:Font s:Underline="Single" s:FontName="Arial" s:Color="#0000FF" /&gt;
    &lt;/s:Style&gt;
    &lt;s:Style s:ID="COLUMN_HEAD"&gt;
      &lt;s:Alignment s:Horizontal="Center" s:WrapText="1" /&gt;
      &lt;s:Font s:Bold="1" s:FontName="Arial" s:Color="#FFFFFF" /&gt;
      &lt;s:Interior s:Color="#6CA76F" s:Pattern="Solid" /&gt;
    &lt;/s:Style&gt;
    &lt;s:Style s:ID="COLUMN_SUBHEAD"&gt;
      &lt;s:Alignment s:WrapText="1" /&gt;
      &lt;s:Font s:FontName="Arial" s:Color="#006600" /&gt;
      &lt;s:Interior s:Color="#B5D6B7" s:Pattern="Solid" /&gt;
    &lt;/s:Style&gt;
    &lt;s:Style s:ID="HIGHLIGHT"&gt;
      &lt;s:Alignment s:WrapText="1" /&gt;
      &lt;s:Font s:FontName="Arial" s:Color="#000000" /&gt;
      &lt;s:Interior s:Color="#D2E3FF" s:Pattern="Solid" /&gt;
    &lt;/s:Style&gt;
    &lt;s:Style s:ID="HIGHLIGHT_BOLD"&gt;
      &lt;s:Alignment s:WrapText="1" /&gt;
      &lt;s:Font s:Bold="1" s:FontName="Arial" s:Color="#000000" /&gt;
      &lt;s:Interior s:Color="#D2E3FF" s:Pattern="Solid" /&gt;
    &lt;/s:Style&gt;
    &lt;s:Style s:ID="HIGHLIGHT_SUBTLE"&gt;
      &lt;s:Alignment s:WrapText="1" /&gt;
      &lt;s:Font s:FontName="Arial" s:Color="#000000" /&gt;
      &lt;s:Interior s:Color="#E7F0FF" s:Pattern="Solid" /&gt;
    &lt;/s:Style&gt;
    &lt;s:Style s:ID="HIGHLIGHT_LINK"&gt;
      &lt;s:Alignment s:WrapText="1" /&gt;
      &lt;s:Font s:Underline="Single" s:FontName="Arial" s:Size="14" s:Color="#000000" /&gt;
      &lt;s:Interior s:Color="#D2E3FF" s:Pattern="Solid" /&gt;
    &lt;/s:Style&gt;
    &lt;s:Style s:ID="GRANDTOTAL"&gt;
      &lt;s:Alignment s:WrapText="1" /&gt;
      &lt;s:Font s:Bold="1" s:FontName="Arial" s:Color="#000000" /&gt;
      &lt;s:Interior s:Color="#F0F0F0" s:Pattern="Solid" /&gt;
    &lt;/s:Style&gt;
    &lt;s:Style s:ID="HIGHLIGHT_C"&gt;
      &lt;s:Alignment s:WrapText="1" /&gt;
      &lt;s:Font s:FontName="Arial" s:Color="#000000" /&gt;
      &lt;s:Interior s:Color="#D2E3FF" s:Pattern="Solid" /&gt;
      &lt;s:NumberFormat s:Format="_(* #,##0.00_);_(* \(#,##0.00\);_(* 0.00_);_(@_)" /&gt;
    &lt;/s:Style&gt;
    &lt;s:Style s:ID="REGULAR_C"&gt;
      &lt;s:Alignment s:WrapText="1" /&gt;
      &lt;s:Font s:FontName="Arial" s:Color="#000000" /&gt;
      &lt;s:NumberFormat s:Format="_(* #,##0.00_);_(* \(#,##0.00\);_(* 0.00_);_(@_)" /&gt;
    &lt;/s:Style&gt;
    &lt;s:Style s:ID="HIGHLIGHT_P"&gt;
      &lt;s:Alignment s:WrapText="1" /&gt;
      &lt;s:Font s:FontName="Arial" s:Color="#000000" /&gt;
      &lt;s:Interior s:Color="#D2E3FF" s:Pattern="Solid" /&gt;
      &lt;s:NumberFormat s:Format="Percent" /&gt;
    &lt;/s:Style&gt;
    &lt;s:Style s:ID="REGULAR_P"&gt;
      &lt;s:Alignment s:WrapText="1" /&gt;
      &lt;s:Font s:FontName="Arial" s:Color="#000000" /&gt;
      &lt;s:NumberFormat s:Format="Percent" /&gt;
    &lt;/s:Style&gt;
  &lt;/s:Styles&gt;
  &lt;s:Worksheet s:Name="Service"&gt;
    &lt;s:Table&gt;
      &lt;s:Column s:Width="170" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Column s:Width="80" /&gt;
      &lt;s:Row&gt;
        &lt;s:Cell s:StyleID="BOLD"&gt;
          &lt;s:Data s:Type="String"&gt;Project&lt;/s:Data&gt;
        &lt;/s:Cell&gt;
        &lt;s:Cell s:StyleID="REGULAR_NO_WRAP"&gt;
          &lt;s:Data s:Type="String"&gt;VNNWASXX-VENWAS&lt;/s:Data&gt;
        &lt;/s:Cell&gt;
      &lt;/s:Row&gt;
      &lt;s:Row&gt;
        &lt;s:Cell s:StyleID="BOLD"&gt;
          &lt;s:Data s:Type="String"&gt;Forecast Period&lt;/s:Data&gt;
        &lt;/s:Cell&gt;
        &lt;s:Cell s:StyleID="REGULAR_NO_WRAP"&gt;
          &lt;s:Data s:Type="String"&gt;Oct 2015&lt;/s:Data&gt;
        &lt;/s:Cell&gt;
      &lt;/s:Row&gt;
      &lt;s:Row&gt;
        &lt;s:Cell s:StyleID="BOLD"&gt;
          &lt;s:Data s:Type="String"&gt;Page&lt;/s:Data&gt;
        &lt;/s:Cell&gt;
        &lt;s:Cell s:StyleID="REGULAR_NO_WRAP"&gt;
          &lt;s:Data s:Type="String"&gt;Revenue Details&lt;/s:Data&gt;
        &lt;/s:Cell&gt;
      &lt;/s:Row&gt;
      &lt;s:Row&gt;
        &lt;s:Cell s:StyleID="BOLD"&gt;
          &lt;s:Data s:Type="String"&gt;Currency&lt;/s:Data&gt;
        &lt;/s:Cell&gt;
        &lt;s:Cell s:StyleID="REGULAR_NO_WRAP"&gt;
          &lt;s:Data s:Type="String"&gt;EUR&lt;/s:Data&gt;
        &lt;/s:Cell&gt;
      &lt;/s:Row&gt;
      &lt;s:Row&gt;
        &lt;s:Cell s:StyleID="COLUMN_HEAD"&gt;
          &lt;s:Data s:Type="String" /&gt;
        &lt;/s:Cell&gt;
        &lt;s:Cell s:StyleID="COLUMN_HEAD"&gt;
          &lt;s:Data s:Type="String"&gt;Usa / Canada&lt;/s:Data&gt;
        &lt;/s:Cell&gt;
        &lt;s:Cell s:StyleID="COLUMN_HEAD"&gt;
          &lt;s:Data s:Type="String"&gt;Europe / Africa&lt;/s:Data&gt;
        &lt;/s:Cell&gt;
        &lt;s:Cell s:StyleID="COLUMN_HEAD"&gt;
          &lt;s:Data s:Type="String"&gt;Asia / Pacific&lt;/s:Data&gt;
        &lt;/s:Cell&gt;
        &lt;s:Cell s:StyleID="COLUMN_HEAD"&gt;
          &lt;s:Data s:Type="String"&gt;EDS - EU Clinic&lt;/s:Data&gt;
        &lt;/s:Cell&gt;
        &lt;s:Cell s:StyleID="COLUMN_HEAD"&gt;
          &lt;s:Data s:Type="String"&gt;Total&lt;/s:Data&gt;
        &lt;/s:Cell&gt;
      &lt;/s:Row&gt;
      &lt;s:Row&gt;
        &lt;s:Cell s:MergeAcross="5" s:StyleID="COLUMN_SUBHEAD"&gt;
          &lt;s:Data s:Type="String"&gt;Contract&lt;/s:Data&gt;
        &lt;/s:Cell&gt;
      &lt;/s:Row&gt;
      &lt;s:Row&gt;
        &lt;s:Cell s:StyleID="HIGHLIGHT"&gt;
          &lt;s:Data s:Type="String"&gt;Total Contract Value (Gross NBA)&lt;/s:Data&gt;
        &lt;/s:Cell&gt;
        &lt;s:Cell s:StyleID="HIGHLIGHT_C"&gt;
          &lt;s:Data s:Type="Number"&gt;33181&lt;/s:Data&gt;
        &lt;/s:Cell&gt;
        &lt;s:Cell s:StyleID="HIGHLIGHT_C"&gt;
          &lt;s:Data s:Type="Number"&gt;75425.67&lt;/s:Data&gt;
        &lt;/s:Cell&gt;
        &lt;s:Cell s:StyleID="HIGHLIGHT_C"&gt;
          &lt;s:Data s:Type="Number"&gt;0&lt;/s:Data&gt;
        &lt;/s:Cell&gt;
        &lt;s:Cell s:StyleID="HIGHLIGHT_C"&gt;
          &lt;s:Data s:Type="Number"&gt;0&lt;/s:Data&gt;
        &lt;/s:Cell&gt;
        &lt;s:Cell s:StyleID="HIGHLIGHT_C"&gt;
          &lt;s:Data s:Type="Number"&gt;108606.67&lt;/s:Data&gt;
        &lt;/s:Cell&gt;
      &lt;/s:Row&gt;
</code></pre>

<p>I tried using the following code</p>

<pre><code>public void readXMLFile(String fileName){
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = null;
    try {
        builder = factory.newDocumentBuilder();
    } catch (ParserConfigurationException e1) {
        // TODO Auto-generated catch block
        e1.printStackTrace();
    }

    Document doc = null;
    try {
        doc = builder.parse(fileName);
    } catch (SAXException | IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

    NodeList labTestList = doc.getElementsByTagName("s:Worksheet");
    for (int i = 0; i &lt; labTestList.getLength(); ++i)
    {
        Element labTest = (Element) labTestList.item(i);
        String labTestType = labTest.getAttribute("s:Name");

        NodeList valueList = labTest.getElementsByTagName("s:Row");
        for (int j = 0; j &lt; valueList.getLength(); ++j)
        {
            Element value = (Element) valueList.item(j);
            String valueType = value.getAttribute("s:Type");

            NodeList conditionList = value.getElementsByTagName("s:Cell");
            for (int k = 0; k &lt; conditionList.getLength(); ++k)
            {
</code></pre>