in reply to XML tree to HASH

You could store the info $hash{$element}{$parentID} = 1;

Then if ($hash{$element}{$parentID}) would tell you if it was a parent or not. I'm not sure if its any better than sticking them all in a string and regexing it. If you do regex make sure to delimit each id so that checking for 2 doesn't match the 2 in 20.

Eric Hodges