#!/usr/bin/perl use strict; use warnings; use XML::Twig; my $xmlstr = < test light information test light informa EOF my $twig = XML::Twig->new( twig_roots => {INFO => 1}, twig_print_outside_roots => 1, ); $twig->parse($xmlstr); __END__ test light test light