<div>
<span class="apple1evil">123</span>
<span class="apple!evil">456</span>
<span class="appleCevil">789</span>
<span class="appleRevil">000</span>
</div>
//div/span[@class[starts-with(.,'apple')][substring(.,string-length()-3)='evil']]