use Data::Dumper; my $content = join '', ; my $response = XMLin($content); print Dumper($response); #### $VAR1 = { 'offer' => { '6' => { 'zip' => '48120', 'transit' => '1', 'smoking' => {}, 'phone_public' => '1', 'state' => 'MI' }, '60046' => { 'zip' => '80236', 'transit' => '1', 'smoking' => {}, 'phone_public' => '1', 'state' => 'CO' }, '7' => { 'zip' => '43240', 'transit' => '1', 'smoking' => {}, 'phone_public' => '1', 'state' => 'MI' } } }; #### my $response = XMLin($content); for my $id (keys %{$response->{offer}}) { print $response->{offer}->{$id}->{zip}, "\n"; } #### 48120 80236 43240