in reply to Counting number of child nodes based on element value
something like this mike
$XML = XML::LibXML->load_xml( string => $xml_string # parser options ... ); [download]