in reply to XML::In out of memory!

Use a pull parser. XML::LibXML has one, it's called XML::LibXML::Reader, and it's accessible from XML::XSH2 via the stream command.
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ