using AngleSharp.Xml.Parser;
public static string Xml = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\"><url><loc>https://www.immomig-portal.ch/de/accounts/profile</loc><xhtml:link rel=\"alternate\" hreflang=\"fr\" href=\"https://www.immomig-portal.ch/fr/accounts/profile\" /><xhtml:link rel=\"alternate\" hreflang=\"en\" href=\"https://www.immomig-portal.ch/en/accounts/profile\" /><xhtml:link rel=\"alternate\" hreflang=\"it\" href=\"https://www.immomig-portal.ch/it/accounts/profile\" /><changefreq>weekly</changefreq><priority>0.4</priority></url></urlset>";
public static void Main()
var parser = new XmlParser();
var doc = parser.ParseDocument(Xml);
var test = doc.DocumentElement.SelectNodes("//urlset/url/xhtml:link");
foreach (var entry in test)
Console.WriteLine(string.Join(",", entry.TextContent));