title: Correct syntax for including boolean expressions in XPath; specifically not & and
body: <p>In order to find <code>&lt;li&gt;</code> elements that contain the text "memory" but not the text "Graphics", I have tried a dozen variation of:</p>
  
  <pre><code>//li[contains(text(), "memory")] and li[not contains(text(), "Graphics")]
  //li[contains(text(), "memory")] and [not contains(text(), "Graphics")]
  //li[contains(text(), "memory") and not contains(text(), "Graphics")]
  etc etc
  </code></pre>
  
  <p>While I've found posts on Stackoverflow that point to the use of individual boolean operators like <code>not</code>, I can find nothing that explains how to combine them to filter text like this. What's the trick?</p>