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//from  w  w w.  ja v  a  2s.co  m
{
    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