use XML::Twig; my $t = XML::Twig->new( twig_roots => { Doc => \&mutilate_doc, }, ); $t->parse(\*DATA); sub mutilate_doc { my( $t, $doc)= @_; $doc->print; print "\n",'x'x69,"\n"; } __END__ hey man hey man, how's it goin'? pretty right on.