using System.Collections;
using System.Collections.Generic;
using System.Data.DataSetExtensions;
public static void Main()
string anchorTags = null;
anchorTags = "<p>" + anchorTags + "</p>";
Dictionary<string, string> dict = new Dictionary<string, string>();
foreach(XElement element in XDocument.Parse(anchorTags).Descendants("a"))
dict.Add(element.Value, element.Attribute("href").Value);
Console.WriteLine(element.Value);
Console.WriteLine(element.Attribute("href").Value);
Dictionary<string, string> d = XDocument.Parse(anchorTags).Descendants("a").ToDictionary(element => element.Value, element => element.Attribute("href").Value);