Why don't you use XPathQeury , which is designed by Matt Gallagher.
This library is very good for analyzing not only XML data, but also HTML data using XPath.
You can use the following XPathQuery function.
NSArray *PerformHTMLXPathQuery(NSData *document, NSString *query);
source share