Skip to content

Instantly share code, notes, and snippets.

@clausjoergensen
Created September 27, 2011 19:34
Show Gist options
  • Save clausjoergensen/1245994 to your computer and use it in GitHub Desktop.
Save clausjoergensen/1245994 to your computer and use it in GitHub Desktop.
var document = XDocument.Load(File.OpenRead(@"myfile.xml"));
var entities = document.Element("ImportExportXml").Element("Entities").Elements("Entity");
var result =
entities.Elements("Entity")
.SelectMany(
e => e.Element("EntityInfo").Element("attributes").Elements("attribute"))
.Distinct();
result.Dump();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment