#! perl -w use strict; use CGI; use XML::Simple; my $cgi= new CGI; my $xs = new XML::Simple(); my $elements = $cgi->Vars(); my %copy = %$elements; my $xml = $xs->XMLout(\%copy, rootname => 'source'); print $xml; __DATA__ #output C:\test>184342 "test=1&fred=bill&something=somethingelse" '