use strict; use warnings; use XML::Twig; my $t= XML::Twig->new( pretty_print => 'indented', twig_handlers => { # $_[1] is the element 'html/body/html' => sub{ $_[1]->print;} }); my $data =<

Hello

this is a test

this is a second test

some kind of wrapped footer

EOXML $t->parse( $data); ## output

Hello

this is a test

this is a second test