XDocument code example

Example: XDocument

<Departments>
   <Department>Account</Department>
   <Department>Sales</Department>
   <Department>Pre-Sales</Department>
   <Department>Marketing</Department>
</Departments>
using System;
using System.Xml.Linq;
namespace DemoApplication{
   public class Program{
      public static void Main(){
         string xmlString = @"<Departments>
            <Department>Account</Department>
            <Department>Sales</Department>
            <Department>Pre-Sales</Department>
            <Department>Marketing</Department>
         </Departments>";
         XDocument xml = XDocument.Parse(xmlString);
         Console.ReadLine();
      }
   }
}

Tags:

Misc Example