Not tested but
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];
if (rootElemnt) {
TBXMLElement *item = [TBXML childElementNamed:@"item" parentElement:rootElemnt];
while (item) {
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];
[addArray addObject:dictData];
item = [TBXML nextSiblingNamed:@"item" searchFromElement:item];
}
}
NSLog(@"====%@",addArray);
should work