You have a service that receives a very large XML-based history file once a month. These files can be up to 20GB in size, and you need to retrieve the header information that contains the history date range and the customer information on which this file is based.Which class would be more appropriate to retrieve the data in these files?

XmlReader class is stream-based; you can open the file and read until you retrieve the information you need and then close the file. Thus, you don't need to allocate memory to hold the entire XML file.

The XmlDocument class needs to load the complete XML file into memory before it can be used. even if your computer had enough memory, this operation would be painfully slow.