I have a large xml file (about 84MB) which is in this form:
...
....
...
There are 2 species of XML parsers (this applies to any language).
DOM parsing (which is what you are using). In this type the whole XML file is read into a memory structures and then accessed by methods.
SAX parsing. This is a parsing algorithm that reads each piece of XML in a step-wise fashion. This technique would allow you to better detect and deal with errors.
In general DOM is easier than SAX because a lot of the gritty details are dealt with by its native methods.
SAX is a bit more of a challenge because you have to code methods that the SAX parsing "runs" during is walk of the XML document.