I don't know dick for X-code or whatever iPhone uses, but in any other langauge, I would:
1: Read what I needed to from a file.
2: Put each "line" into a an array, vector, or some other type of container
3: Read the line I need (last one) and do something.
I still don't know exactly what you're doing. You lost me at that fruit tangent. If I'm to understand this, you've got a bunch of data to display: Album, Artist, Song.
In C++, I would probably define my own class of album type, artist type, and song type. The artist type would have a container with albums types . The album type would have a container of song types. In C++ I'd use a vector as it can dynamically grow (easily). Then, you just have to have something to parse the data and populate the containers.
EDIT: I understand a bit more now. The last string in the XML file is basically the string in which you're searching, right? That will have an impact on your data structure. In my example, if that is a song (and no artist or album to cross-reference against) you have to loop internally through 3 containers. Can get taxing.