To find all element nodes that contain a given token in an attribute value or text node, you can use this:
//*[text()[contains(., 'token')] or @*[contains(., 'token')]]
Be aware that this will fail when the text is interrupted by other markup, for example in <p>foo<em>bar</em></p>
.