my $t= XML::Twig->new(       # the twig will include just the root and selected titles           twig_roots   => { 'section/title' => \&print_n_purge,                             'annex/title'   => \&print_n_purge           }                      );  $t->parsefile( 'doc.xml');