views:

86

answers:

3

I sometimes do this:

XElement.Descendants("mynodename");

is there a way to do something like this"

XElement.Descendants("mynodename or myothernodename");
+4  A: 

Not in one method call - but you can use:

element.Descendants()
       .Where(x => x.Name.LocalName == "mynodename" 
                   || x.Name.LocalName == "myothernodename")
Jon Skeet
+2  A: 

Or,

XElement.Descendants("mynodename")
  .Union(XElement.Descendants("myothernodename"));

Which would sort them by type, then in order of appearance...

Will
A: 

both of those examples don't work btw

wera