GDataXMLDocument *doc2; doc2= [[GDataXMLDocument alloc] initWithXMLString: str options:0 error:&error]; ///////////// //XML GDataXMLElement *root = [doc2 rootElement]; NSLog(@"Element Name = %@", root.name); NSLog(@"Type = %@",[[root attributeForName:@"errcode"] stringValue]); for (int i=0; i <[root childCount]; i++) { GDataXMLElement *element = [root childAtIndex:i]; NSLog(@"Element Name = %@", element.name); NSLog(@"Type = %@", [[element attributeForName:@"type"] stringValue]); for (int j=0; j<[element childCount]; j++) { GDataXMLElement *subItem = [element childAtIndex:j]; NSLog(@"Sub Name = %@", subItem.name); NSLog(@"Sub value = %@", subItem.stringValue); } }