title: how to store all dictionary in an array
body: <p>i have an xml file which contains country and codes. i have put the xml in Demo.xml .My problem is that only first dictionary has been saved. or anyone can tell me other way of parsing it like using nsxml or gdata</p>
  
  <pre><code>NSString *filePath=[[NSBundle mainBundle] pathForResource:@"Demo" ofType:@"xml"];
  NSData *data=[NSData dataWithContentsOfFile:filePath];
  addArray=[[NSMutableArray alloc]init];
  dictData=[[NSMutableDictionary alloc]init];
  
  
  TBXML *tbxml = [TBXML tbxmlWithXMLData: data];
  TBXMLElement *rootXMLElement=tbxml.rootXMLElement;
  
  TBXMLElement *rootElemnt=[TBXML childElementNamed:@"root" parentElement:rootXMLElement];
  while (rootElemnt!=nil) {
  
      TBXMLElement *item = [TBXML childElementNamed:@"item" parentElement:rootElemnt];
  
      if (item!=nil) {
          TBXMLElement *country = [TBXML childElementNamed:@"country" parentElement:item];
          TBXMLElement *code = [TBXML childElementNamed:@"code" parentElement:item];
  
          dictData=[NSMutableDictionary dictionaryWithObjectsAndKeys:[TBXML textForElement:country],@"country",[TBXML textForElement:code],@"code",nil];
          rootElemnt = [TBXML nextSiblingNamed:@"item" searchFromElement:rootElemnt];
  
          [addArray addObject:dictData];
      }
  }
  NSLog(@"====%@",addArray);
  </code></pre>
  
  <p>And the outPut is:</p>
  
  <pre><code>====(
          {
              code = 355;
              country = Albania;
          }
      )
  </code></pre>
  
  <p>Here is the link of xml <a href="https://www.dropbox.com/s/x4zpxgi42h0rllz/Demo.xml" rel="nofollow">https://www.dropbox.com/s/x4zpxgi42h0rllz/Demo.xml</a></p>