title: Parsing an NSXMLElement in Cocoa
body: <p>I'm trying to use XPath to parse an XML document. One of my NSXMLElement's looks like the following, hypothetically speaking:</p>
  
  <pre><code>&lt;foo bar="yummy"&gt;
  </code></pre>
  
  <p>I'm trying to get the value for the attribute bar, however any interpretation of code I use, gives me back bar="woo", which means I need to do further string processing in order to obtain access to woo and woo alone.</p>
  
  <p>Essentially I'm doing something like</p>
  
  <pre><code>NSArray *nodes = [xmlDoc nodesForXPath:@"foo/@bar" error:&amp;error];
  xmlElement = [nodes objectAtIndex:0];
  </code></pre>
  
  <p>Is there anyway to write the code above to just give me yummy, versus bar="yummy" so I can relieve myself of parsing the string?</p>
  
  <p>Thanks.</p>
  
  <hr>
  
  <p>Assuming TouchXML is being used, is there still anyway to obtain similar results? As in grabbing just the value for the attribute, without the attribute="value"? That results in then further having to parse the string to get the value out.</p>