 <p>You can add a condition that applies to a relative (or absolute node) to any step of an XPath expression.</p> <p>In this case:</p> <pre><code>//*[@id=substring-after(/Reference/@URI, '#')] </code></pre> <p>The <code>//*</code> matches all elements in the document. The part in <code>[]</code> is a condition. Inside the condition the part of the URI element of the root References node is taken, but ignoring the '#' (and anything before it).</p> <p>Sample code, assuming you have loaded your XML into <code>XPathDocument</code> <code>doc</code>:</p> <pre><code>var nav = doc.CreateNavigator(); var found = nav.SelectSingleNode("//*[@id=substring-after(/Reference/@URI, '#')]"); </code></pre>