sub get_path { my ($node) = @_; my $path = '';; my $p = $node; while (defined my $p = $p->parentNode) { $path = $p->nodeName . "/" . $path }; };