Creating XML Document using LINQ

Creating XML Document using LINQ

 

XDocument EmployeeInfo = new XDocument(

            new XElement("Employees",

            new XElement("Employee Name",

            new XElement("Name", "Vishal Shah"),

            new XElement("PhoneNumber", "123-456-7899")),

            new XElement("Employee Name",

            new XElement("Name", "Raju Jindal"),

            new XElement("PhoneNumber", "123-456-7898")

            )

            );

            Console.WriteLine(EmployeeInfo);

            Console.ReadLine();

 

-Shinu