title: Java XML nested Parser not working
body: <p>The XML parser is not working and I'm getting the following error:</p>
  
  <blockquote>
    <p>org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1;
    Content is not allowed in prolog.     at
    com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:257)
      at
    com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
      at openexcel.xmlreader.main(xmlreader.java:24)</p>
  </blockquote>
  
  <p>Here is my XML document </p>
  
  <pre><code>&lt;/service&gt;
   &lt;/services&gt;
   &lt;solutions&gt;
        &lt;solution&gt;
             &lt;cost&gt;505.9214670746815&lt;/cost&gt;
             &lt;routes&gt;
                  &lt;route&gt;
                       &lt;driverId&gt;noDriver&lt;/driverId&gt;
                       &lt;vehicleId&gt;1_1&lt;/vehicleId&gt;
                       &lt;start&gt;0.0&lt;/start&gt;
                       &lt;act type="service"&gt;
                            &lt;serviceId&gt;5 WassimKarim maudarbaccus&lt;/serviceId&gt;
                            &lt;arrTime&gt;109.9819741964403&lt;/arrTime&gt;
                            &lt;endTime&gt;119.9819741964403&lt;/endTime&gt;
                       &lt;/act&gt;
                       &lt;end&gt;229.9639483928806&lt;/end&gt;
                  &lt;/route&gt;
                  &lt;route&gt;
                       &lt;driverId&gt;noDriver&lt;/driverId&gt;
                       &lt;vehicleId&gt;3_1&lt;/vehicleId&gt;
                       &lt;start&gt;0.0&lt;/start&gt;
                       &lt;act type="service"&gt;
                            &lt;serviceId&gt;4 Jean Nicolas Yung&lt;/serviceId&gt;
                            &lt;arrTime&gt;109.98190391287031&lt;/arrTime&gt;
                            &lt;endTime&gt;119.98190391287031&lt;/endTime&gt;
                       &lt;/act&gt;
                       &lt;act type="service"&gt;
                            &lt;serviceId&gt;2 George Bush&lt;/serviceId&gt;
                            &lt;arrTime&gt;119.98282618841856&lt;/arrTime&gt;
                            &lt;endTime&gt;129.98282618841856&lt;/endTime&gt;
                       &lt;/act&gt;
                       &lt;act type="service"&gt;
                            &lt;serviceId&gt;3 Saddam Usain&lt;/serviceId&gt;
                            &lt;arrTime&gt;129.98343325287408&lt;/arrTime&gt;
                            &lt;endTime&gt;139.98343325287408&lt;/endTime&gt;
                       &lt;/act&gt;
                       &lt;act type="service"&gt;
                            &lt;serviceId&gt;1 Barack OBama&lt;/serviceId&gt;
                            &lt;arrTime&gt;139.98435552842233&lt;/arrTime&gt;
                            &lt;endTime&gt;149.98435552842233&lt;/endTime&gt;
                       &lt;/act&gt;
                       &lt;end&gt;259.9673220629237&lt;/end&gt;
                  &lt;/route&gt;
             &lt;/routes&gt;
        &lt;/solution&gt;
        &lt;solution&gt;
             &lt;cost&gt;505.9208295302417&lt;/cost&gt;
             &lt;routes&gt;
                  &lt;route&gt;
                       &lt;driverId&gt;noDriver&lt;/driverId&gt;
                       &lt;vehicleId&gt;1_2&lt;/vehicleId&gt;
                       &lt;start&gt;0.0&lt;/start&gt;
                       &lt;act type="service"&gt;
                            &lt;serviceId&gt;5 Oppa Gamnamstyle&lt;/serviceId&gt;
                            &lt;arrTime&gt;109.9819741964403&lt;/arrTime&gt;
                            &lt;endTime&gt;119.9819741964403&lt;/endTime&gt;
                       &lt;/act&gt;
                       &lt;end&gt;229.9639483928806&lt;/end&gt;
                  &lt;/route&gt;
                  &lt;route&gt;
                       &lt;driverId&gt;noDriver&lt;/driverId&gt;
                       &lt;vehicleId&gt;3_1&lt;/vehicleId&gt;
                       &lt;start&gt;0.0&lt;/start&gt;
                       &lt;act type="service"&gt;
                            &lt;serviceId&gt;4 Jean Nicolas Yung&lt;/serviceId&gt;
                            &lt;arrTime&gt;109.98190391287031&lt;/arrTime&gt;
                            &lt;endTime&gt;119.98190391287031&lt;/endTime&gt;
                       &lt;/act&gt;
                       &lt;act type="service"&gt;
                            &lt;serviceId&gt;2 Emilie Sparks&lt;/serviceId&gt;
                            &lt;arrTime&gt;119.98282618841856&lt;/arrTime&gt;
                            &lt;endTime&gt;129.98282618841856&lt;/endTime&gt;
                       &lt;/act&gt;
                       &lt;act type="service"&gt;
                            &lt;serviceId&gt;1 Denzel Wshington&lt;/serviceId&gt;
                            &lt;arrTime&gt;129.98372097890456&lt;/arrTime&gt;
                            &lt;endTime&gt;139.98372097890456&lt;/endTime&gt;
                       &lt;/act&gt;
                       &lt;act type="service"&gt;
                            &lt;serviceId&gt;3 Mona Lisa&lt;/serviceId&gt;
                            &lt;arrTime&gt;139.9846432544528&lt;/arrTime&gt;
                            &lt;endTime&gt;149.9846432544528&lt;/endTime&gt;
                       &lt;/act&gt;
                       &lt;end&gt;259.9668316441239&lt;/end&gt;
                  &lt;/route&gt;
             &lt;/routes&gt;
        &lt;/solution&gt;
   &lt;/solutions&gt;
  &lt;/problem&gt;
  </code></pre>
  
  <p>I'm trying to get several fields (cost,driverid,vehicleid,start,act,serviceId,arrTime) for every entity in the XML file.</p>
  
  <p>What I've been trying so far is</p>