title: How to Parse XML using libxml2 in Objective C
body: <p>This is my XML</p>
  
  <pre><code>&lt;MyXML ID="tester" Server="example.com"&gt;
    &lt;CONF&gt;
      &lt;MYAPP LOCN="/Application/data/" DATADIR="/tmp/data"&gt;
       ..
    &lt;/CONF&gt;
  &lt;/MyXML&gt;
  </code></pre>
  
  <p>This is the Code i'm using</p>
  
  <pre><code>  NSString *xmlFilePath =@"/Applications/conf/MyConf.xml";
    NSLog(@"%@",xmlFilePath);
    NSData *xmlData = [NSData dataWithContentsOfFile:xmlFilePath];
    NSString *xPathQuery =@"/MyXML";
    NSArray *xmlArray = PerformXMLXPathQuery(xmlData,xPathQuery);
  </code></pre>
  
  <p>It gives me the full XML as NSArray. How to traverse through this NSArray or, how to use XPath to get exactly the Nodes and attributes. 
  I've used </p>
  
  <pre><code>  NSString *xPathQuery =@"/MyXML[@ID]";
  </code></pre>
  
  <p>but it doesn't returns the attribute ID, it just returns null.</p>
  
  <p>I think it would be best to traverse through the NSArray, but how to do that(I'm a newbie to Objective C and when i looked for traversing through the NSArray returned by ,i've just got examples for HTML NSArray only)</p>