in reply to Re^3: XML::LibXML out of memory
in thread XML::LibXML out of memory

Thanks.

I got round the problem with

next if $reader->nodeType != XML_READER_TYPE_ELEMENT;

As recommended to me.