(taken from http://msdn2.microsoft.com/en-us/library/ms998559.aspx)
Choose the Appropriate XML Class for the Job
To help you choose the appropriate .NET Framework class to process XML, consider the following guidelines:
· Use XmlTextReader to process XML data quickly in a forward, read-only manner without using validation, XPath, and XSLT services.
· Use XmlValidatingReader to process and to validate XML data. Process and validate the XML data in a forward, read-only manner according to an XML schema or a DTD.
· Use XPathNavigator to obtain read-only, random access to XML data and to use XPath queries. To create an XPathNavigator object over an XML document, you must call the XPathDocument.CreateNavigator method.
· Use XmlTextWriter to write XML documents. You cannot use XmlTextWriter to update XML documents.
· Use the XmlTextReader and XmlTextWriter, in combination, for simple transformations rather than resorting to loading an XmlDocument or using XSLT. For example, updating all the price element values in a document can be achieved by reading with the XmlTextReader, updating the value and then writing to the XmlTextWriter, typically by using the WriteNode method.
· Use the XmlDocument class to update existing XML documents, or to perform XPath queries and updates in combination. To use XPath queries on the XmlDocument, use the Select method.
· If possible, use client-side XML processing to improve performance and to reduce bandwidth.
posted @ Monday, March 12, 2007 1:23 AM