title: XML Parsing with JSoup - access only the first result element
body: <p>I'm trying to use Google's geocoding API to access information about a specific address. When I make a request to the API for a specific address, it returns multiple Lat-Lng results, but I only want to choose the first one.</p>
  
  <p>I am using JSoup to parse the document. </p>
  
  <p>Here is some of the data in the xml result:</p>
  
  <pre><code>&lt;GeocodeResponse&gt;
  &lt;status&gt;OK&lt;/status&gt;
  &lt;result&gt;
  &lt;geometry&gt;
  &lt;location&gt;
     &lt;lat&gt;53.3619592&lt;/lat&gt;
     &lt;lng&gt;-6.2785289&lt;/lng&gt;
  &lt;/location&gt;
  &lt;viewport&gt;
  &lt;southwest&gt;
     &lt;lat&gt;53.3606102&lt;/lat&gt;
     &lt;lng&gt;-6.2798779&lt;/lng&gt;
  &lt;/southwest&gt;
  &lt;northeast&gt;
     &lt;lat&gt;53.3633082&lt;/lat&gt;
     &lt;lng&gt;-6.2771799&lt;/lng&gt;
  &lt;/northeast&gt;
  &lt;/viewport&gt;
  &lt;/geometry&gt;
  &lt;/result&gt;
  
  &lt;result&gt;
  &lt;geometry&gt;
  &lt;location&gt;
     &lt;lat&gt;53.3725435&lt;/lat&gt;
     &lt;lng&gt;-6.3210070&lt;/lng&gt;
  &lt;/location&gt;
  &lt;viewport&gt;
  &lt;southwest&gt;
     &lt;lat&gt;53.3711945&lt;/lat&gt;
     &lt;lng&gt;-6.3223560&lt;/lng&gt;
  &lt;/southwest&gt;
  &lt;northeast&gt;
     &lt;lat&gt;53.3738925&lt;/lat&gt;
     &lt;lng&gt;-6.3196580&lt;/lng&gt;
  &lt;/northeast&gt;
  &lt;/viewport&gt;
  &lt;/geometry&gt;
  &lt;/result&gt;
  &lt;/GeocodeResponse&gt;
  </code></pre>
  
  <p>There are 7 of these "result" elements. </p>
  
  <p>I am trying to print out the latlng location of the first result but I'm not exactly sure how to. Here's what I have so far with my java code:</p>
  
  <pre><code>String link = "https://maps.googleapis.com/maps/api/geocode/xml?address=Phibsborough,+Dublin,+Ireland,+CA&amp;region=irl&amp;key=vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv";
  Document doc = Jsoup.connect(link).get();
  for (Element e : doc.select("result")) {
      System.out.println(e.select("lat"));
      System.out.println(e.select("lng"));
  }
  </code></pre>
  
  <p>And it is printing out like this:</p>
  
  <pre class="lang-none prettyprint-override"><code>&lt;lat&gt;
    53.3619592
  &lt;/lat&gt;
  &lt;lat&gt;
   53.3619592
  &lt;/lat&gt;
  &lt;lat&gt;
   53.3619592
  &lt;/lat&gt;
  &lt;lng&gt;
   -6.2785289
  &lt;/lng&gt;
  &lt;lng&gt;
   -6.2785289
  &lt;/lng&gt;
  &lt;lng&gt;
   -6.2785289
  &lt;/lng&gt;
  &lt;lat&gt;
    53.3619592
  &lt;/lat&gt;
  &lt;lat&gt;
   53.3619592
  &lt;/lat&gt;
  &lt;lat&gt;
   53.3619592
  &lt;/lat&gt;
  &lt;lng&gt;
   -6.2785289
  &lt;/lng&gt;
  &lt;lng&gt;
   -6.2785289
  &lt;/lng&gt;
  &lt;lng&gt;
   -6.2785289
  &lt;/lng&gt;
  &lt;lat&gt;
    53.3619592
  &lt;/lat&gt;
  &lt;lat&gt;
   53.3619592
  &lt;/lat&gt;
  &lt;lat&gt;
   53.3619592
  &lt;/lat&gt;
  &lt;lng&gt;
   -6.2785289
  &lt;/lng&gt;
  &lt;lng&gt;
   -6.2785289
  &lt;/lng&gt;
  &lt;lng&gt;
   -6.2785289
  &lt;/lng&gt;
  &lt;lat&gt;
    53.3619592
  &lt;/lat&gt;
  &lt;lat&gt;
   53.3619592
  &lt;/lat&gt;
  &lt;lat&gt;
   53.3619592
  &lt;/lat&gt;
  &lt;lng&gt;
   -6.2785289
  &lt;/lng&gt;
  &lt;lng&gt;
   -6.2785289
  &lt;/lng&gt;
  &lt;lng&gt;
   -6.2785289
  &lt;/lng&gt;
  &lt;lat&gt;
    53.3619592
  &lt;/lat&gt;
  &lt;lat&gt;
   53.3619592
  &lt;/lat&gt;
  &lt;lat&gt;
   53.3619592
  &lt;/lat&gt;
  &lt;lng&gt;
   -6.2785289
  &lt;/lng&gt;
  &lt;lng&gt;
   -6.2785289
  &lt;/lng&gt;
  &lt;lng&gt;
   -6.2785289
  &lt;/lng&gt;
  &lt;lat&gt;
    53.3619592
  &lt;/lat&gt;
  &lt;lat&gt;
   53.3619592
  &lt;/lat&gt;
  &lt;lat&gt;
   53.3619592
  &lt;/lat&gt;
  &lt;lng&gt;
   -6.2785289
  &lt;/lng&gt;
  &lt;lng&gt;
   -6.2785289
  &lt;/lng&gt;
  &lt;lng&gt;
   -6.2785289
  &lt;/lng&gt;
  &lt;lat&gt;
    53.3619592
  &lt;/lat&gt;
  &lt;lat&gt;
   53.3619592
  &lt;/lat&gt;
  &lt;lat&gt;
   53.3619592
  &lt;/lat&gt;
  &lt;lng&gt;
   -6.2785289
  &lt;/lng&gt;
  &lt;lng&gt;
   -6.2785289
  &lt;/lng&gt;
  &lt;lng&gt;
   -6.2785289
  &lt;/lng&gt;
  </code></pre>