XPath: Limit cell content, if delimiter exists
<p>I need to get the content of a cell, which occasionally contains a <code>','</code> character. If so, I need to isolate the content to the portion before the <code>','</code> character.</p>

<pre><code>substring-before(//td[contains(text(),'Dokumentnummer')]/following-sibling::td[1],\",\")
</code></pre>

<p>This gives me the desired substring, but only <em>if</em> a <code>','</code> exists. How can I make it return the whole string, if it <em>does'nt</em> exist?</p>