in reply to XML::LibXML drives me to drinking

You used the proper namespace here:

$xml->findnodes('/x:ItemLookupResponse/x:Items/x:Item')

But you forgot here:

$item->findvalue('ASIN')

Change the latter to

$xml->findvalue('x:ASIN', $item)

Other issues:


Fixed:

#!/usr/bin/perl use strict; use warnings qw( all ); use feature qw( say ); use XML::LibXML qw( ); use XML::LibXML::XPathContext qw( ); my $xml = <<'__EOS__'; <?xml version="1.0"?> <ItemLookupResponse xmlns="http://webservices.amazon.com/AWSECommerceS +ervice/2013-08-01"> <Items> <Item> <ASIN>B01KI4JSQY</ASIN> </Item> </Items> </ItemLookupResponse> __EOS__ my $doc = XML::LibXML->load_xml(string => $xml, { no_blanks => 1 }); my $xpc = XML::LibXML::XPathContext->new(); $xpc->registerNs('x', 'http://webservices.amazon.com/AWSECommerceServi +ce/2013-08-01'); for my $item ($xpc->findnodes('/x:ItemLookupResponse/x:Items/x:Item', +$xml)) { say $item->firstChild->nodeName; say $item->firstChild->toString; say $xpc->findvalue('x:ASIN', $item); }