use strict; use warnings; use XML::Simple; use Data::Dumper; my $str = "lexwhere=\"'in('DIS', 'DIM', 'DIR')'\" title=\"'this is a title'\""; my $str_xml = ""; print $str_xml, "\n"; my $ref = XMLin($str_xml); print Dumper($ref);