title: how to parse gdata xml in iPhone?
body: <p>here is xml</p>
  
  <pre><code>Root---&gt;
       Subject---&gt;
             SubjectID 1   /SubjectID
             SubjectName MatheMatics /SubjectName
                         Sub_Subject----&gt;
                                 Sub_SubjectID 1 /Sub_SubjectID
                                 Sub_SubjectName Calculus /Sub_SubjectName
                         /Sub_Subject
                         Sub_Subject
                         Sub_SubjectID 2 /Sub_SubjectID
                         Sub_SubjectName Geometry /Sub_SubjectName
                         /Sub_Subject
        /Subject
        Subject----&gt;
              SubjectID 2 /SubjectID
              SubjectName Physics /SubjectName
        /Subject
  /Root 
  </code></pre>
  
  <p>in app i want to show subject name in tableviewcontroller when application launch &amp; when we clicked on tableviewcell it leads on another table view which shows sub_subject list.</p>
  
  <p>how to achieve this 
  for that.</p>
  
  <pre><code>+ (NSString *)dataFilePath:(BOOL)forSave {
      return [[NSBundle mainBundle] pathForResource:@"SubjectData" ofType:@"xml"];
  }
  
  + (RootSubject *)loadParty {
  
      NSString *filePath = [self dataFilePath:FALSE];
      NSData *xmlData = [[NSMutableData alloc] initWithContentsOfFile:filePath];
      NSError *error;
      GDataXMLDocument *doc = [[GDataXMLDocument alloc] initWithData:xmlData 
                                                             options:0 error:&amp;error];
    /*  if (doc == nil) { return nil; }
  
      NSLog(@"%@", doc.rootElement);
  
      [doc release];
      [xmlData release];
      return nil;*/
      RootSubject *rootSubject = [[[RootSubject alloc] init] autorelease];
  
      NSArray *partyMembers = [doc nodesForXPath:@"//Root/Subject" error:nil];
      //NSArray *patry = [doc nodesForXPath:@"//Root/Subject/SunjectID" error:nil];
      for (GDataXMLElement *partyMember in partyMembers) {
  
          // Let's fill these in!
          NSString *subjectId, *subjectName, *sub_SubjectId, *sub_SubjectName;
  
  
          // senderName
          NSArray *subjectIds = [partyMember elementsForName:@"SubjectID"];
          if (subjectIds.count &gt; 0) {
              GDataXMLElement *firstName = (GDataXMLElement *) [subjectIds objectAtIndex:0];
              subjectId = firstName.stringValue;
          } else continue;
  
          // senderEmail
          NSArray *subjectNames = [partyMember elementsForName:@"SubjectName"];
          if (subjectNames.count &gt; 0) {
              GDataXMLElement *firstLevel = (GDataXMLElement *) [subjectNames objectAtIndex:0];
              subjectName = firstLevel.stringValue;
          } else continue;
  
      /*  //senderPhone
          NSArray *sub_SubjectIds = [partyMember elementsForName:@"Sub_SubjectID"];
          if (sub_SubjectIds.count &gt; 0) {
              GDataXMLElement *firstName = (GDataXMLElement *) [sub_SubjectIds objectAtIndex:0];
              sub_SubjectId = firstName.stringValue;
          } else continue;
  
          //senderLocation
          NSArray *sub_SubjectNames = [partyMember elementsForName:@"Sub_SubjectName"];
          if (sub_SubjectNames.count &gt; 0) {
              GDataXMLElement *firstName = (GDataXMLElement *) [sub_SubjectNames objectAtIndex:0];
              sub_SubjectName = firstName.stringValue;
          } else continue;*/
  
          //Subject *subject = [[[Subject alloc]initWithSubjectId:subjectId subjectName:subjectName sub_SubjectId:sub_SubjectId sub_SubjectName:sub_SubjectName]autorelease];
          Subject *subject = [[[Subject alloc]initWithSubjectId:subjectId subjectName:subjectName sub_SubjectId:nil sub_SubjectName:nil]autorelease];
          //Subject *subject = [[[Subject alloc]initWithSubjectId:subjectId subjectName:nil sub_SubjectId:sub_SubjectId sub_SubjectName:sub_SubjectName]autorelease];
  
          //[rootGroup.groups addObject:group];
          [rootSubject.subjects addObject:subject];
  
      }
      [doc release];
      [xmlData release];
      return rootSubject;
  
  
  
  }
  </code></pre>
  
  <p>through this we get subject name and show it perfectly in tableviewcontroller but when i clicked on particular subject which provides subsubject in another view controller</p>