my ($node) = $dom->findnodes('/doc/text'); my $text = join '', $node->childNodes(); print "$text\n";