title: Xpath to find the first child if a sibling contains certain text
body: <p>I need to find the XPATH for <code>&lt;li&gt;Test1&lt;/li&gt;</code> in this case if the list contains <code>&lt;li&gt;Sample&lt;/li&gt;</code>.</p>
  
  <p>Example of Tags:</p>
  
  <pre><code>&lt;ul&gt;
          &lt;li&gt;Test1&lt;/li&gt;
          &lt;li&gt;Test2&lt;/li&gt;
          &lt;li&gt;Sample&lt;/li&gt;
  &lt;/ul&gt;
  
  &lt;ul&gt;
          &lt;li&gt;TestA&lt;/li&gt;
          &lt;li&gt;TestB&lt;/li&gt;
          &lt;li&gt;TestC&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>There can be multiple <code>&lt;ul&gt;</code> tags</p>
  
  <p>Have been able to find whether li contains Sample using below query</p>
  
  <pre class="lang-none prettyprint-override"><code>//ul/li[contains(.,'Sample')]
  </code></pre>
  
  <p>Any thoughts on how to find the xpath of <code>&lt;li&gt;Test1&lt;/li&gt;</code>?</p>