title: expression builder for XML
body: <p>In my program I get passed some XML. If values in this XML fulfil a user defined criteria I store the xml otherwise it gets discarded. The problem I have is that I need to be able to allow the user to define the criteria (also combining multiple element with “OR” and “AND”) and then applying this when I get the XML. This is a C# application, can anyone recommend a library, tool or help in which way I should go about resolving this problem? Shown below is the XML that I will receive. The user may only want to store this if <code>&lt;unit&gt; =1</code> AND (the first part of <code>&lt;data&gt; = Z</code> OR <code>&lt;data&gt;</code> has ABC after the second coma).</p>
  
  <pre><code>&lt;interface&gt;
    &lt;mac&gt;12345&lt;/mac&gt;
    &lt;device&gt;DeviceTypeA&lt;/device&gt;
    &lt;id&gt;TestUnit&lt;/id&gt;
    &lt;data&gt;
      &lt;unit&gt;1&lt;/unit&gt;
      &lt;transaction&gt;
        &lt;event&gt;0&lt;/event&gt;
        &lt;data&gt;Z,0,ABC,1234&lt;/data&gt;
        &lt;time&gt;2010-06-29T11:33:44.0000000Z&lt;/time&gt;
      &lt;/transaction &gt;
    &lt;/data&gt;
  &lt;/interface&gt;
  </code></pre>