Question: Is it possible to set the filter constraints to 'OR' in linq-to-xml? I iterate through an array in order to filter desired values like this:

```
XElement root = XElement.Load(fileName);
IEnumerable<XElement> selectedElements = root.Elements("OrderNum").Elements("Job");

for (int i = 1; i < chkBx.Count(); i++)
{
    if (chkBx[i].Checked == true)
    {
        string element = "Diameter";
        string match = chkBx[i].Text;
        selectedElements = selectedElements.Where(el => (string)el.Parent.Element(element) == match);
    }
}

```

Now the filter will kinda be linked together with an 'AND' statement. What if i want to select an element that statisfy any of these filter conditions?

Answer: 
```
var filters = chkBx.Where(r => r.Checked).Select(r => r.Text).ToList();
selectedElements = selectedElements.Where(r =>
      filters.Contains((string)r.Parent.Element(element)))

```
You have three options, depending on the scenario:

* you could `.Union` the queries each time (which could make for a lot of overhead, I suspect)
* you could build a custom expression (lots of work, and not really a good fit for LINQ to Objects)
* you could build a `HashSet<string>` of the matches (my preferred option)

i.e.

```
HashSet<string> matches = new HashSet<string>();

// this next bit can probably be simplified, perhaps using LINQ;
// left alone as it is orthogonal
for (int i = 1; i < chkBx.Count(); i++)   
 {
        if (chkBx[i].Checked == true)
        {
            string element = "Diameter";
            matches .Add(chkBx[i].Text);
        }
    }

var selectedElements = selectedElements.Where(el =>
      matches.Contains((string)el.Parent.Element(element)));

```