function findTranslations(xml_doc, the_word) {
  // obvious variable declarations and initializations (omitted)
  var these_translations = new Array();
  var english_word_elements = xml_doc.getElementsByTagName("english");
  var reg_exp = new RegExp("^" + the_word);
  while ((loop < english_word_elements.length) && (found == false)) {
    this_word = english_word_elements[loop].firstChild.nodeValue;
    if (reg_exp.test(this_word)) {
      the_translation =
        english_word_elements[loop].nextSibling.firstChild.nodeValue;
      found = true;
    }
    loop++; 
  }
  if (found == true) {
    these_translations.push(this_word + "\t" + the_translation);
    for (var count = loop; count < (loop + 10); count++) {
      if (count < english_word_elements.length) {
        this_word = english_word_elements[count].firstChild.nodeValue;
        if (reg_exp.test(this_word)) {
          the_translation =
            english_word_elements[count].nextSibling.firstChild.nodeValue;
          these_translations.push(this_word + "\t" + the_translation);
        }
      }
    }
  }
  return these_translations;
}
