using System.Collections.Generic;
public static class Program
public static void Main()
<PolicyResponseMessage xmlns=""urn:oasis:names:tc:legalxml-courtfiling:schema:xsd:CourtPolicyResponseMessage-4.0"" xmlns:j=""http://niem.gov/niem/domains/jxdm/4.0"" xmlns:nc=""http://niem.gov/niem/niem-core/2.0"" xmlns:mark=""urn:mark:ecf:extensions:Common"" xmlns:ecf=""urn:oasis:names:tc:legalxml-courtfiling:schema:xsd:CommonTypes-4.0"">
<RuntimePolicyParameters>
<ECFElementName>nc:CaseCategoryText</ECFElementName>
<nc:Date>2012-10-10</nc:Date>
<nc:IdentificationID>https://Test1.com</nc:IdentificationID>
<ECFElementName>mark:CaseTypeText</ECFElementName>
<nc:Date>2012-10-10</nc:Date>
<nc:IdentificationID>https://Test2.com</nc:IdentificationID>
</RuntimePolicyParameters>
</PolicyResponseMessage>";
List<CodeTableUrl> lUrls = new List<CodeTableUrl>();
XDocument elements = XDocument.Parse(sPayload);
string dataSet_nc = "http://niem.gov/niem/niem-core/2.0";
string ns = "urn:oasis:names:tc:legalxml-courtfiling:schema:xsd:CourtPolicyResponseMessage-4.0";
lUrls = elements.Descendants(XName.Get("RuntimePolicyParameters", ns))
.Elements(XName.Get("CourtCodelist", ns))
.Select(d => new CodeTableUrl
.Element(XName.Get("CourtCodelistURI", ns))
.Element(XName.Get("IdentificationID", dataSet_nc)) ?? ""
foreach (CodeTableUrl url in lUrls)
Console.WriteLine(url.sUrl);
public class CodeTableUrl
public String sUrl { get; set; }