How to select multiple elements (with different names) in a LINQ to XML query?
I have a query like this:
var elems = from descendant in doc.Descendants("foo")
select descendant;
But I want to select both foo and bar, sort of like:
var elems = from descendant in doc.Descendants("foo" || "bar")
select descendant;
But this is just to illustrate what I want to do, I know that this is not the correct syntax. I do not know how this should be done with LINQ to XML, so what is the right way to do this?
source
share