use XML::Dumper; my $struct = { "ferret" => ["sredni", "vashtar"], "hen" => "anabaptist", }; my $xdumper = new XML::Dumper; # generate xml equiv to struct my $ssxmlified = $xdumper->pl2xml($struct); # write it to file as well $xdumper->pl2xml($struct, "oot.txt"); # reconstitute our struct from the file my $structreconstituted = $xdumper->xml2pl("oot.txt"); # generate xml===reconstituted struct $rexmlified = $xdumper->pl2xml($structreconstituted); my $sscequal = $xdumper->xml_compare($rexmlified, $ssxmlified); my $ssiequal = $xdumper->xml_identity($rexmlified, $ssxmlified); printf "xml_compare: %s\n", ($sscequal? "true" : "false"); printf "xml_identity:%s\n", ($ssiequal? "true" : "false");