title: Extracting the first table's first row
body: <p>I'm trying to extract the first table row (tr) of the first table (table) object in a parsed XML document.</p>
  
  <p>I thought that the following will do the trick:</p>
  
  <pre><code>//table[1]//tr[1]//text()
  </code></pre>
  
  <p>Yet it returns too many nodes, for example in <a href="http://en.wikipedia.org/wiki/Public_transport_timetable" rel="nofollow">this page</a> I wish to return:</p>
  
  <pre><code>Wikimedia Commons has media related to 
  Public transport schedules
  </code></pre>
  
  <p>but the text of the following node which is clearly not part of the first row also returns:</p>
  
  <pre><code>&lt;div style="font-size:110%"&gt;&lt;a href="/wiki/Public_transport" title="Public transport"&gt;Public transport&lt;/a&gt;&lt;/div&gt;
  </code></pre>
  
  <p>(only the text appears yet I patch the full node so it will be easier to find it)</p>