<p>I'm attempting to check for the existence of a node using the following .NET code:</p>

<pre><code>xmlDocument.SelectSingleNode(
        String.Format("//ErrorTable/ProjectName/text()='{0}'", projectName));
</code></pre>

<p>This always raises:</p>

<blockquote>
  <p>XPathException: Expression must evaluate to a node-set. </p>
</blockquote>

<p>Why am I getting this error and how can I resolve it? Thank you.</p>

Try:
```
```
Node node = xmlDocument.SelectSingleNode(String.Format("//ErrorTable/ProjectName = '{0}'", projectName));

if (node != null) {
    // and so on
}
```
```
Edit: silly error