A more optimal XPath would be: `id('value-selector-container')/descendant::li[descendant::span[.='%s']]`