title: If then else in XPath 1.0
body: <p>I have the next expression:</p>
  
  <pre><code>population = tree.xpath('(//tr/td/b/a[contains(text(), "Population")]/../../following-sibling::td/span/following-sibling::text())[1] or'
                              '//tr/td/b/a[contains(text(), "Population")]/../../following-sibling::td/span/text())
  </code></pre>
  
  <p>which returns 'True'.</p>
  
  <p>If I use "|" instead of 'or', it combines values of the 1st and 2nd paths, like this <code>['11 061 886', '▼']</code>.</p>
  
  <p>How to make the logic like:</p>
  
  <pre><code>If the 1st path exists:
      get the 1st value
  elif the 2nd path exists:
      get the 2nd value
  else:
      pass
  </code></pre>
  
  <p>?</p>
  
  <p>I understand that this is simple, but can't find the answer.</p>