my $hash = { a => 'b' , c => 'd', hash => { key1 => 'value1', key2 => 'value2' }, array => [ "arrayval1", { subhashkey => 'subhashvalue' }, [ # XXX - folded arrays will be flattened by actual implementation { nome1 => 'subarray1' } , { nome2 => 'subarray2' , 'nome2.5' => 'dfsdf'}, { nested => { nested2_1 => 'nestedvalue', nested2_2 => 'nestedvalue2' } }, "subarrayval1", "subarrayval2" ] ] }; my $txml = XML::TinyXML->new($hash); printf("%s \n", $txml->dump);