<p>How can I use XPath to select an XML-node based on its content? </p>

<p>If I e.g. have the following xml and I want to select the &lt;author&gt;-node that contains Ritchie to get the author's full name:</p>

<pre><code>&lt;books&gt;
    &lt;book isbn='0131103628'&gt;
        &lt;title&gt;The C Programming Language&lt;/title&gt;
        &lt;authors&gt;
            &lt;author&gt;Ritchie, Dennis M.&lt;/author&gt;
            &lt;author&gt;Kernighan, Brian W.&lt;/author&gt;
        &lt;/authors&gt;
    &lt;/book&gt;
    &lt;book isbn='1590593898'&gt;
        &lt;title&gt;Joel on Software&lt;/title&gt;
        &lt;authors&gt;
            &lt;author&gt;Spolsky, Joel&lt;/author&gt;
        &lt;/authors&gt;
    &lt;/book&gt;
&lt;/books&gt;
</code></pre>

The XPath for this is:
```
```
/books/book/authors/author[contains(., 'Ritchie')]
```
```
In C# the following code would return "Ritchie, Dennis M.":
```
```
xmlDoc.SelectSingleNode("/books/book/authors/author[contains(., 'Ritchie')]").InnerText;
```
```