title: The most efficient way to parse Xml
body: <p>The .Net framework now has (at least) four different methods of reading an Xml string. I've used each of XmlDocument, XmlReader, XPath and XElement, but which is the most efficient to use when coding or during execution? Is each designed for a different task, what are the pros and cons?</p>
  
  <hr>
  
  <p><b>Update:</b>
  Using a XmlReader appears to be the quickest way to read xml, which sound reasonable to me, but has it's limitations. I would like to know if there is any performance difference between XmlDocument and XLinq for accessing xml non-sequentially.</p>
  
  <hr>
  
  <p><b>Update:</b>
  I found some posts comparing the different methods of loading an xml document. XmlReader is the fastest, there is insignificant difference between XmlDocument and LINQ to XML until you load a document with 10,000+ node where LINQ to XML comes out in front.</p>
  
  <ul>
  <li><a href="http://www.nearinfinity.com/blogs/page/jferner?entry=performance_linq_to_sql_vs" rel="noreferrer">http://www.nearinfinity.com/blogs/page/jferner?entry=performance_linq_to_sql_vs</a></li>
  <li><a href="http://www.hanselman.com/blog/AtAGlanceXmlReaderVsXPathNavigatorVsXmlDocument.aspx" rel="noreferrer">http://www.hanselman.com/blog/AtAGlanceXmlReaderVsXPathNavigatorVsXmlDocument.aspx</a></li>
  </ul>