in reply to Grouping output statements into one location during recursive operation

Hello,

Why don't you do something like this:

foreach (@node) { my $xml = traverse($_); print $xml; } sub traverse { my($node)= @_; if ($node->getType == XML_ELEMENT_NODE) { my $txt = "<" . $node->getName . ">"; foreach my $child ($node->childNodes()) { $txt .= traverse($child); } return $txt . "</" . $node->getName . ">"; } elsif ($node->getType() == XML_TEXT_NODE) { return $node->getData; } }
Hope this helps,,,

Aziz,,,