in reply to Re^2: Not a HASH reference
in thread Not a HASH reference

$xml->{SD} is an arrayref, so $xml->{SD}{AMZN} is not a thing.

I strongly advise switching to a saner XML module. XML::LibXML is my favourite.