using System.Collections.Generic;
public static void Main()
<Key_Head>Name1</Key_Head>
<Key_Title>value1</Key_Title>
<Key_Head>name2</Key_Head>
<Key_Title>value2</Key_Title>
var doc1 = XDocument.Parse(xml);
var result = ConvertXmlToDic(doc1.Root);
foreach (var item in result)
Console.WriteLine(item.ToString());
private static List<NameValuePair> ConvertXmlToDic(XElement element)
var result = element.Elements()
.Select(e => new NameValuePair
Name = e.Element("Key_Head").Value,
Value = e.Element("Key_Title").Value
public class NameValuePair
public override string ToString()
return String.Format("Name: {0}, Value: {1}", Name, Value);