That is true. The XmlDocument must load the entire XML structure in memory
and construct a tree. My unofficial guess is that the memory footprint is
probably exponential when given larger documents.
The XmlTextReader only processes what it has to and does not maintain a tree
structure. The XmlDocument allows you to go anywhere and to anything, the
XmlTextReader is forward-only and cannot be modified.
If you are only reading the document, and you know the structure, then an
XmlTextReader would be more efficient.
It is really a judgement call as to what you use.
"MFRASER" <mf*****@henwoodenergy.com> wrote in message
news:uV**************@TK2MSFTNGP09.phx.gbl...
I am trying to import some data into my objects and I have been using
XMLDoc.LoadXML(file), but someone told me that this is very memory
intensive that if I am reading a text file that I would be better off using
XMLTextReader. Has anyone had the same experience?