$ 0 0 I don't think ram is the biggest issue here, but your disk. You will be killing your disk if you have 10M items in a xml-file and you write to it often.