Performance: XDocument versus XmlDocument

XmlDocument is a purely managed implemenation of the Document Object Model. There is no interop with any COM components, such as the MSXML library. Any claim otherwise is completely bogus. The entire XLinq set of APIs came about as a friendlier way to interact with XML with introduction of LINQ in the .NET Framework.

If you’re trying to maximize performance and are comfortable using XPath, try using the XmlDocument and using compiled XPath expressions.

Leave a Comment