print $twig -> root -> first_child_text('name'),"\n"; print $twig -> root -> first_child('profcats') -> first_child_text('name'),"\n"; foreach my $element ( $twig -> root -> children ) { print $element -> tag, ": ", $element -> text,"\n"; foreach my $sub ( $element -> children ) { print "\t",$sub -> tag, ": ", $sub -> text,"\n"; foreach my $subsub ( $sub -> children ) { print "\t\t",$subsub -> tag, ": ", $sub -> text,"\n"; foreach my $subsubsub ( $subsub -> children ) { print "\t\t\t", $subsubsub -> tag, ": ", $subsubsub -> text,"\n"; } } } }