my $xml = getXML($url); # retrieve it thru http my $parser = new XML::DOM::Parser; my $doc = $parser->parse($xml); # This first snippet would take as much as 2Gigs of memory.