my $parser = XML::Rules->new ( rules => [ root => 'no content', parent => 'no content array', ch1 => 'content array', ch2 => 'content array', ] ); my $result = $parser->parsestring($xml);