CSharp - Parsing an XML String into an Element

Description

Parsing an XML String into an Element

Demo

using System;
using System.Linq;
using System.Xml.Linq;
using System.Collections.Generic;

class Program//ww  w  . j  ava  2  s. c om
{
    static void Main(string[] args){
          string xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?><Books>" +
            "<Book type=\"Author\" experience=\"first-time\" language=" +
            "\"English\"><FirstName>Joe</FirstName><LastName>Ruby</LastName>" +
            "</Book></Books>";
    
          XElement xElement = XElement.Parse(xml);
          Console.WriteLine(xElement);
    }
}

Result