selenium xpath to select following-sibling
<p>I have the following HTML:</p>

<pre><code>&lt;tr class="k-grouping-row" role="row"&gt;
&lt;td aria-expanded="true" colspan="6"&gt;
&lt;p class="k-reset"&gt;
&lt;a class="k-icon k-i-collapse" tabindex="-1" href="#"&gt;&lt;/a&gt;
&lt;span class="consolidation-group" style="font-weight: bold;" data-key="aedfdb66-bb11-4350-9d25-21941820141b"&gt;jhmfgjf (2 Items)&lt;/span&gt;
&lt;/p&gt;
&lt;a class="k-button unconsolidation-link" onclick="UnConsolidateGroup("aedfdb66-bb11-4350-9d25-21941820141b", "8780f45d-0e81-4f5c-b206-61b682b27d67")" title="Unconsolidate all matter entries in this group"&gt;
&lt;span class="marginRight5 icon-unlink"&gt;&lt;/span&gt;
Unconsolidate All
&lt;/a&gt;
&lt;/td&gt;
</code></pre>



<p>I would like to click on the span "Unconsolidate All" using <code>following-sibling</code> operator. I tried the following code:</p>

<pre><code>//span[contains(text(), 'jhmfgjf')]/../following-sibling::class[@title='Unconsolidate all matter entries in this group']
</code></pre>

<p>But it does not work, the first part does work, it's just the <code>following-sibling</code> part that does not work.</p>

<p>Any help would be helpful</p>