title: Filtering list of XElements against a dictionary
body: <p>Here is my xml file :</p>
  
  <pre><code>&lt;items&gt;
    &lt;item code="1"&gt;
      &lt;info1&gt;LOREM&lt;/info1&gt;
      &lt;info2&gt;IPSUM&lt;/info2&gt;
      &lt;info3&gt;DOLOR&lt;/info3&gt;
    &lt;/item&gt;
    &lt;item code="2"&gt;
      &lt;info1&gt;LOREM&lt;/info1&gt;
      &lt;info2&gt;AMET&lt;/info2&gt;
      &lt;info3&gt;CONSECTETUER&lt;/info3&gt;
    &lt;/item&gt;
    &lt;item code="3"&gt;
      &lt;info1&gt;LOREM&lt;/info1&gt;
      &lt;info2&gt;IPSUM&lt;/info2&gt;
      &lt;info3&gt;CONSECTETUER&lt;/info3&gt;
    &lt;/item&gt;
  &lt;/items&gt;
  </code></pre>
  
  <p>I want to extract some item codes based on criterias stored on that dictionary :</p>
  
  <pre><code>{ "info1", "LOREM" }
  { "info2", "IPSUM" }
  </code></pre>
  
  <p>I wrote that linq query :</p>
  
  <pre><code>var test =  from element in xml.Descendants("item").Elements()
          from param in dicoParams
          where param.Key == element.Name.ToString() &amp;&amp; param.Value == element.Value
          select element.Parent.Attribute("code");
  </code></pre>
  
  <p>but the output is :</p>
  
  <pre><code>code="1"
  code="1"
  code="2"
  code="3"
  code="3"
  </code></pre>
  
  <p>and what I expected is :</p>
  
  <pre><code>code="1"
  code="3"
  </code></pre>
  
  <p>We can notice that the query returned elements satisfying at least one condition, but I want it to satisfy both conditions.</p>
  
  <p>How could I wrote that query ?</p>