It would be nice to know what you are actually going to do with XML. The way you parse it depends a lot on the processing you have to do, as well as the size.
If this is a one-time task, then I started in the past by opening the XML structure before doing anything else. My DTDGenerator (see Saxon.sf.net) was written for this purpose a long time ago and still does the job, now there are other tools, but I donβt know if they do thread processing, which is a prerequisite here.
You can write an application that processes data using the pull or push parser (SAX or StAX). How easy it depends on how much processing you need to do and how much state you have to maintain, which you did not tell us. Alternatively, you can try the XSLT streaming available in Saxon-EE.
Michael kay
source share