If you just want the node closest to the text you're searching for, you could use this:
$('*:contains("my text"):last');
This will even work if your HTML looks like this:
blah blah my text
Using the above selector will find the
tag, since that's the last tag which contains that entire string.