title: XPath expression for element based on containing text
body: <p>I'm running out of ideas. I have identified for my Selenium test an div based on its text ("security administrator ") contained. Unfortunately, the div contains two other divs. See the example.</p>
  
  <pre><code>&lt;div class="rich-stglpanel-marker"&gt;
      &lt;div class="rich-stglpnl-marker" id="j_id194:j_id198:2:j_id199_switch_on" style="display: none"&gt;&lt;/div&gt;
      &lt;div class="rich-stglpnl-marker" id="j_id194:j_id198:2:j_id199_switch_off"&gt;&lt;/div&gt;
      security administrator 
  &lt;/div&gt;
  &lt;div class="rich-stglpanel-marker"&gt;
      &lt;div class="rich-stglpnl-marker" id="j_id194:j_id198:2:j_id199_switch_on" style="display: none"&gt;&lt;/div&gt;
      &lt;div class="rich-stglpnl-marker" id="j_id194:j_id198:2:j_id199_switch_off"&gt;&lt;/div&gt;
      technical administrator 
  &lt;/div&gt;
  ... and so on
  </code></pre>
  
  <p>I tried that expressions:</p>
  
  <pre><code>//div[text()='security administrator']
  //div[text()='security administrator ']
  //div[text()='security administrator&amp;nbsp;']
  //div[text()='security administrator${nbsp}'] (this is a special hack from selenium)
  </code></pre>
  
  <p>Nothing works. Any ideas?</p>
  
  <p>Thanks in advance.</p>