title: How to get the text of a node before its first child node by xpath?
body: <p><code>&lt;a&gt;mytext&lt;b&gt;other&lt;/b&gt;&lt;a&gt;</code></p>
  <p>Suppose that I have the above XML data, I'd like to extract &quot;mytext&quot;. But <code>//a</code> will retrieve both <code>mytext</code> and <code>other</code>. Is there a way to extract the text before the first child node of <code>&lt;a&gt;</code>?</p>