public static String trimRight(String str) {
    int right = str.length() - 1;
    while (right >= 0 && Verifier.isXMLWhitespace(str.charAt(right))) {
      right--;
    }
    if (right < 0) {
      return "";
    }
    return str.substring(0, right + 1);
  }
public static String trimRight(String str)