Given the following XML:
abcText1cba abcText2cba
Just for readers. The xpath is correct. OP: Perhaps xpath parser didnt support the expression?
/root/li[span[contains(text(), "Text1")]]