use XML::Twig; my $tTwig = XML::Twig->new( pretty_print => 'indented', output_text_filter => 'html', ); $tTwig->set_xml_version( '1.0' ); $tTwig->set_output_encoding( 'utf-8' ); my $tLog = XML::Twig::Elt->new( 'log', q(
won't escape properly - uggh!) ); $tTwig->set_root( $tLog ); $tTwig->print;