my $parser=XML::Simple->new(); my $doc = $parser->XMLin("./config.xml",, ForceArray => qr{Resource} , keyAttr=> { 'server', 'name',KeepRoot => 1 });