in reply to How to find the value of the first and last occurence of an XML node?
It is relatively easier if you use Expat Parser to parse the xml file and extract the contents based wrt tag. You may just require two functions strt and end.