in reply to Recursion problem

I think your problem is here:

$$all .= "</", $node->getName, ">\n";
which should be changed to
$$all .= "</" . $node->getName . ">\n";
for two reasons. First, .= has higher precedence than the comma (which is why you're getting those void context warnings, I think). Second, the reason it's higher precedence is that as far as I know, .= evaluates its RHS in scalar context: assigning a list to it doesn't get you anywhere.



If God had meant us to fly, he would *never* have given us the railroads.
    --Michael Flanders