need help to parse xml string
<p>i need to parse this xml file </p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;imageset&gt;
&lt;category&gt;
&lt;image&gt;SQUIRREL&lt;/image&gt;
&lt;image&gt;FOX&lt;/image&gt;  
&lt;image&gt;TIGER&lt;/image&gt;    
&lt;image&gt;LION&lt;/image&gt; 
&lt;/category&gt;
&lt;/imageset&gt;
</code></pre>

<p>i use this code to parse this.</p>

<pre><code>- (void)viewDidLoad {
    NSXMLParser *parser = [[NSXMLParser alloc] initWithData:[NSData dataWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"Config.xml"]]];
    [super viewDidLoad];
    [parser setDelegate:self];
    [parser parse];
    NSLog(@"test.......... %@",test);
    }
- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict{            
    if ([elementName isEqualToString:@"image"]) {
        test = [[NSMutableArray alloc]init];
        addelements = TRUE;
    }
}
- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName{     
    if ([elementName isEqualToString:@"image"]) {
        addelements = FALSE;
    }
}
- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string{
        [test addObject:string];
}
</code></pre>

<p>But it adds only last object,displays like this in console.</p>

<pre><code>test.......... (
    LION,
    "\n\n",
    "\n"
)
</code></pre>

<p>I need to add all image names in the xml file means {SQUIRREL,FOX,TIGER,LION}</p>

<p>how can i done,can any one please help me.</p>

<p>Thank u in advance.  </p>
