title: xmpp IQ XML parsing in iOS
body: <p>I received the following XML IQ and want to parse it in iOS. Please help!     </p>
  
  <pre><code>     &lt;iq type="result"&gt;
          &lt;stories xmlns="success"&gt;
  
              &lt;storyid&gt;1&lt;/storyid&gt;
              &lt;title&gt;THE TITLE&lt;/title&gt;
              &lt;picture&gt;BASE64EncodedStringOfImage&lt;/picture&gt;
  
              &lt;storyid&gt;2&lt;/storyid&gt;
              &lt;title&gt;Love At First Site&lt;/title&gt;
              &lt;picture&gt;BASE64EncodedStringOfImage&lt;/picture&gt;
  
          &lt;/stories&gt;
       &lt;/iq&gt;
  </code></pre>
  
  <p>I tried the below code but it isn't working. It gets the values in <code>successStoryArray</code> but nothing afterwards. Please help!</p>
  
  <pre><code>    NSXMLElement *stories = [iq elementForName:@"stories"];
      NSArray *successStoryArray = [stories elementsForName:@"storyid"];
      NSLog(@"successStoryArray: %@", successStoryArray);
      for (NSXMLElement *i in successStoryArray)
      {
          NSXMLElement *title = [i elementForName:@"title"];
          NSString *sTitle = [title stringValue];
          NSLog(@"sTitle: %@", sTitle);
          NSXMLElement *picture = [i elementForName:@"picture"];
          NSString *sPicture = [picture stringValue];
          NSLog(@"sPicture: %@", sPicture);
  
      }
  </code></pre>