If you want to read more about LINQ to XML, Microsoft has a lot of great documentation about it on MSDN. This example uses the XDocument and XElement classes to create XML data and save it to a file (or print it to the console). Finally, we'll read RSS data from a blog using an XDocument object, and use LINQ to XML to turn it into a sequence of our own objects that we can code against. This method uses an XDocument and XElement objects to generate an XML document.

You can read more about LINQ to XML and classes in the System. This particular XML document stores the same kind of Starbuzz customer loyalty data we used as sample data in Head First C#. * * Use XElement objects to create elements under the XML tree.

/* * You can use an XDocument to create an XML file, and that includes XML * files you can read and write using Data Contract Serializer. */ The XDocument object's Load() and Save() methods read and write XML files.

Add this code to the Main() entry point method: NOTE: In this tutorial, I'm just showing you how to save and load XML data using an XDocument object.

But you don't necessarily need to use files—once you've got your data in an XDocument object, it's all ready for querying, no matter where you got it.

Also, take a minute and open the XML file in a text editor once you've saved it out to disk.

Here we are studying about Page Output Cache, Output Cache by Parameter, Page Output Cache by Control, Cache by programmatically in C#, Cache location, Output Cache Profiles in Web.config and disable cache in application.

Here we are studying First, First Or Default, Last, Last Or Default, Single, Single Or Default, Element At, Element At Or Default, Take, Take While, Skip, Skip While, Sequence Equal, Except, Intersect, Concat, Distinct methods.

Project Description XML Sorter is a tool than can sort all xml elements and attributes based on user needs.

This operation is important before comparing xml documents.

Hello, I am also looking for this kind of solution, But can anyone help me how to achieve same logic for multiple table with foreign key relations.

XML is one of the most popular formats for files and data streams that need to represent complex data. NET Framework gives you some really powerful tools for creating, loading, and saving XML files.

And once you've got your hands on XML data, you can use LINQ to query anything from data that you created to an RSS feed. Linq namespace, which has a very handy object for processing XML: the XDocument class, which represents an XML document.

Note: The examples here are based on ones we used in the "leftovers" appendix in Head First C#, 2nd ed. There's a lot of depth to an XDocument (no pun intended), but the easiest way to get a handle on it is to see a simple XDocument example.