findText を書いて見ました

<!DOCTYPE html>
<title></title>
<body>
 <div id="hoge">
  <h3>岩手県の<em>最北</em>の町</h3>
  <p><em>洋野町</em>に住んでいる〜!</p>
  <p>I live in the <em>northernmost town</em> in Iwate.</p>
 </div>

<script>
var findText = function findText (root, searchString, iSearchScope, iFlags) {
  var text = [ ];

  if (! root || ! searchString) return null;

  (function ( n ) { // ノード検索
    var m;

    while (true) {
      if (3 == n.nodeType)
        text.push (n.nodeValue.replace (/^\s+|\s+$/g, '\u0020')); //隣接したノードの両方に空白があると?

      if (n.hasChildNodes ())
        n = n.firstChild;
      
      else
        while (true) {
          m = n;
          if (n = n.nextSibling)
            break;

          n = m.parentNode;
          if (n === root)
            return;
        }
    } 
  })(root);
  
  text = text.join ('');
  
  if ('number' === typeof iSearchScope) // 検索開始位置
    text = iSearchScope < 0
      ? text.substring (0, text.length + iSearchScope)
      : text.substring (iSearchScope, text.length);

  if ((iFlags || 0) & 4) { //すべて小文字化
    text = text.toLowerCase ();
    searchString = searchString.toLowerCase ();
  }
  
  if ((iFlags || 0) & 2) // 全一致なら
    return text === searchString;
  
  return -1 !== text.indexOf (searchString);
};

//______

var node = document.getElementById('hoge');
alert (findText (node, '最北の町'));

</script>