XElement and XDocument are very similar in function, but not interchangeable when you are loading a document from a data source. Use XElement.Load () when you want to load everything under the top-level element, Use XDocument.Load () when you want to load any markup before the top-level element.
What is difference between XElement.Load() and XDocument.Load()?
Tagged Interview Questions and Answers, LINQ (Language Integrated Query). Bookmark the permalink.