private static String trimLeadingComment(String text) {
    int start = text.indexOf("<!--");
    int end = text.indexOf("-->");
    if (start == 0 && end > 0) {
      return text.substring(end + "-->".length()).trim();
    }
    else {
      return text;
    }
  }
private static String trimLeadingComment(String text)