title: NSXMLDocument, nodesForXPath with namespaces
body: <p>I want to get a set of elements from a xml-file, but as soon the the elements involve namespaces, it fails.</p>
  
  <p>This is a fragment of the xml file: </p>
  
  <pre><code>&lt;gpx xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
       xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
       version="1.0" creator="Groundspeak Pocket Query"
       xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd http://www.groundspeak.com/cache/1/0 http://www.groundspeak.com/cache/1/0/cache.xsd" 
       xmlns="http://www.topografix.com/GPX/1/0"&gt; 
    &lt;name&gt;My Finds Pocket Query&lt;/name&gt;   
    &lt;desc&gt;Geocache file generated by Groundspeak&lt;/desc&gt;   
    &lt;author&gt;Groundspeak&lt;/author&gt;   
    &lt;email&gt;contact@groundspeak.com&lt;/email&gt; 
    &lt;time&gt;2010-09-15T16:18:55.9846906Z&lt;/time&gt; 
    &lt;keywords&gt;cache, geocache, groundspeak&lt;/keywords&gt;   
    &lt;bounds minlat="41.89687" minlon="5.561883" maxlat="70.669967" maxlon="25.74735" /&gt;    
    &lt;wpt lat="62.244933" lon="25.74735"&gt;
      &lt;time&gt;2010-01-11T08:00:00Z&lt;/time&gt;
      &lt;name&gt;GC22W1T&lt;/name&gt;
      &lt;desc&gt;Kadonneet ja karanneet by ooti, Traditional Cache (1.5/2)&lt;/desc&gt;
      &lt;url&gt;http://www.geocaching.com/seek/cache_details.aspx?guid=4af28fe9-401b-44df-b058-5fd5399fc083&lt;/url&gt;
      &lt;urlname&gt;Kadonneet ja karanneet&lt;/urlname&gt;
      &lt;sym&gt;Geocache Found&lt;/sym&gt;
      &lt;type&gt;Geocache|Traditional Cache&lt;/type&gt;
      &lt;groundspeak:cache id="1521507" available="True" archived="False" xmlns:groundspeak="http://www.groundspeak.com/cache/1/0"&gt;
        &lt;groundspeak:name&gt;Kadonneet ja karanneet&lt;/groundspeak:name&gt;
        &lt;groundspeak:placed_by&gt;ooti&lt;/groundspeak:placed_by&gt;
        &lt;groundspeak:owner id="816431"&gt;ooti&lt;/groundspeak:owner&gt;
        &lt;groundspeak:type&gt;Traditional Cache&lt;/groundspeak:type&gt;
        &lt;groundspeak:container&gt;Small&lt;/groundspeak:container&gt;
        &lt;groundspeak:difficulty&gt;1.5&lt;/groundspeak:difficulty&gt;
        &lt;groundspeak:terrain&gt;2&lt;/groundspeak:terrain&gt;
        &lt;groundspeak:country&gt;Finland&lt;/groundspeak:country&gt;
        &lt;groundspeak:state&gt;
        &lt;/groundspeak:state&gt;
        &lt;groundspeak:short_description html="True"&gt;
        &lt;/groundspeak:short_description&gt;
        &lt;groundspeak:encoded_hints&gt;
        &lt;/groundspeak:encoded_hints&gt;
        &lt;groundspeak:travelbugs /&gt;
      &lt;/groundspeak:cache&gt;   
    &lt;/wpt&gt;
  &lt;/gpx&gt;
  </code></pre>
  
  <p>I want to get all the <code>grounspeak:cache</code> elements, but neither <code>//groundspeak:cache</code> nor <code>//cache</code> seems to return anything.</p>
  
  <pre><code>NSArray *caches = [self.xml nodesForXPath:@"//cache" error:&amp;error];
  </code></pre>
  
  <p>Any clue?</p>
  
  <p>Edit: Are there any cocoa-based software out there, where I can load my xml and test different xpaths? I'm quite new to objective-c and cocoa, so it would be nice to check that it is really my xpath that is wrong..</p>