System.Xml 2.0 Best Practices by Aaron Skonard
At the end of Aaron Skonnard's September 2006 Service Station article on System.Xml 2.0, he summarizes with a list of guidelines. Read and do.
- Always use the static Create factory methods for creating readers and writers, even when you need support for things such as validation.
- If you care about performance, you should always use XPathDocument as your in-memory store when querying or transforming the document.
- Only use XmlDocument when you need an editable store, and when you do need one, use XPathNavigator to write the updating logic.
- Always use XslCompiledTransform to execute XSLT transformations when you're concerned about performance.
- Take advantage of the various API improvements to simplify your code.
- Read "What's New in System.Xml for Visual Studio 2005 and the .NET Framework 2.0 Release," by Mark Fussell