I tried to search for nodes containing text \'Yahoo\' under \'/doc/story/content\', it returns \'content\' node, but I need exact text node that contains \'Yahoo\' or it\'s
Your XML is malformed. should be .
Apart from that, the XPath you would want is
/doc/story/content//*[contains(., 'Yahoo')]
(select any descendant of which contains the text "Yahoo" -- this will select the )