in reply to Objects and Data structure similar to XML

You could use XML::Dumper instead...
use strict; use warnings; use CGI; use Data::Dumper; use XML::Dumper; my $cgi = new CGI; $cgi->{dummy} = new CGI; my $serialized = pl2xml($cgi); print "$serialized\n"; my $deserialized = xml2pl($serialized); print Dumper($deserialized);
And the output -
<perldata> <hashref blessed_package="CGI"> <item key=".charset">ISO-8859-1</item> <item key=".fieldnames"> <hashref> </hashref> </item> <item key=".parameters"> <arrayref memory_address="0x1950ba0"> </arrayref> </item> <item key="dummy"> <hashref blessed_package="CGI"> <item key=".charset">ISO-8859-1</item> <item key=".fieldnames"> <hashref> </hashref> </item> <item key=".parameters"> <arrayref memory_address="0x1ad737c"> </arrayref> </item> <item key="escape">1</item> </hashref> </item> <item key="escape">1</item> </hashref> </perldata> $VAR1 = bless( { '.parameters' => [], '.charset' => 'ISO-8859-1', 'dummy' => bless( { '.parameters' => [], '.charset' => 'ISO-8859-1', '.fieldnames' => {}, 'escape' => '1' }, 'CGI' ), '.fieldnames' => {}, 'escape' => '1' }, 'CGI' );