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 can do this in two ways, one way is to build the expression using expression trees (necessary for IQueryable situations). But since you're querying an in-memory model you can maintain a list of predicates and use the `Any` extension to do the filtering.

```
var predicates = new List<Func<XElement, bool>>();

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

selectedElements = selectedElements.Where(el => predicates.Any(p => p(el)));

```