in reply to Unknown number of XML nodes
Sounds like you want XML::XPath (or, alternatively, XML::LibXML which also has XPath support).
"The first rule of Perl club is you do not talk about Perl club." -- Chip Salzenberg