Skip to content

Instantly share code, notes, and snippets.

@evanricard
Last active February 11, 2020 22:51
Show Gist options
  • Save evanricard/4aed2940dedf9d60bc738e3539022e94 to your computer and use it in GitHub Desktop.
Save evanricard/4aed2940dedf9d60bc738e3539022e94 to your computer and use it in GitHub Desktop.
GetXMLValue
private static string GetXmlValue(string id, string getData, XDocument xdoc)
{
return xdoc.Root.Descendants("girl").Elements().
Where(node => node.Name == "id" && node.Value == id).
Single<XElement>().NodesAfterSelf().
Where(values => ((XElement)values).Name == getData).
Cast<XElement>().Single<XElement>().Value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment