use XML::Dumper; my $xml; my %config = ('a key'=>'a value', 'another key'=>'another value'); my $dumper = XML::Dumper->new(); $xml = $dumper->pl2xml(\%config); print "xml output: ", $xml; my $config = $dumper->xml2pl($xml); die "Uh oh" unless defined $config; exit;