Below is the dump when i do not use keyAttr and Force attributes in declaring the xml variable $VAR1 = { 'response1' => { 'value1' => { 'tag1'=>'value2' 'tag2'=>'value3' 'tag3'=>'value4' }, 'value2' => { 'tag1' => 'value4', 'tag2' => 'value5', 'tag3' => 'value6', } 'value3'=> { 'tag1'=> 'value9' 'tag2'=> 'value10' } };