use strict; use XML::Rules; # at least 0.20 ! -- I just uploaded that version! my $parser = XML::Rules->new( rules => [ _default => 'raw extended array']); my %plugins; %plugins = ( set => sub { die "The plugin requires a name attribute!\n" unless exists($_[0]->{name}); my $content = $_[0]->{_content}; $plugins{$_[0]->{name}} = sub {$content}; return; }, print => sub { print $parser->ToXML( '', process($_[0]->{_content})); return; }, select => sub { die "The This is one. This is the other. And this is yet another. This is NOT printed!