my ($node) = $dom->findnodes('/doc/text'); my @children = $node->childNodes; foreach my $child (@children) { my $type = ref($child); # $type contains the type of the node, ex: "XML::LibXML::Element" }