my $doc = $parser->parse_file($file); print length(@{$doc->findnodes('//category')})