in reply to Record based XML stream processing?

Before I start my ob XML::Twig pitch... ;--)

There are a couple of modules on CPAN that are specifically designed to process record-oriented XML:

Finally XML::Twig was designed especially for this kind of problem. You can easily get rid of part of the document after you are done processing it: you can set a twig_handler for each ArgusFlowRecord, which will call a sub that has access to everything inside the element, then call purge or flush (if you need to output the updated element) and get your memory back./,/p>

See the tutorial, section 4.3 is what you are looking for (n ote that since I wrote the tutorial I added a field method that is equivalent to first_child->text but looks nicer.