title: java xpath return unexpected values
body: <p>I'm builind an application which shows a map with the google api. Using the user input address, I query the API for directions to a destination. The API returns me a XML response which I parse to build my directions objects and show informations to the user.</p>
  
  <p>Everything works but some of my <code>xpath.evaluate()</code> use do not work as I expect. For example this response :</p>
  
  <p><a href="http://maps.googleapis.com/maps/api/directions/xml?origin=700%20Rue%20Wellington,%20Montreal,%20QC%20H3C%202P1,%20Canada&amp;destination=1100,%20rue%20Notre-Dame%20Ouest&amp;waypoints=optimize:true%7C1720,%20rue%20Saint-Denis&amp;mode=driving&amp;sensor=false" rel="nofollow noreferrer">Google Maps Response</a></p>
  
  <p>When I use : </p>
  
  <pre><code>NodeList legList = (NodeList) xpath.evaluate("//route/leg",
                      response, XPathConstants.NODE);
  </code></pre>
  
  <p>Even <code>//leg</code>should do the job right?</p>
  
  <p>When I do a legList.getLength(), it gives me 23 but there are only two leg in the response. Do you know why this strange behavior is happening? I read about <a href="https://stackoverflow.com/questions/2818532/parse-xml-with-xpath-namespaces-in-java">XML Namespace</a> but I still don't know what to do, should I specidfy a namespace even if the answer doesn't contain any, and if yes, why do I have to?</p>