code: public static Set<String> getLanguages(final ITextNode[] textNodes) {
      SortedSet<String> languages = new TreeSet<String>();
      for (ITextNode textNode : textNodes) {
        IValueNode[] valueNodes = textNode.getValueNodes();
        for (IValueNode valueNode : valueNodes) {
          languages.add(valueNode.getLanguage());
        }
      }
      return languages;
    }
docs: Gets the languages of all value nodes whose parents are a given
  array of text nodes.
  @param textNodes the text nodes to extract the languages from
  @return a sorted set containing all languages or an empty set if
  none