private @NlsSafe @Nullable String getDocumentation(String name, String type) {
    try {
      Transformer transformer = templateSupplier.get().newTransformer();
      transformer.setParameter("element", name);
      transformer.setParameter("type", type);
      StringWriter writer = new StringWriter();
      // DOMSource doesn't work
      transformer.transform(new StreamSource(new StringReader(documentSupplier.get())), new StreamResult(writer));

      String s = writer.toString();
      Matcher matcher = check.matcher(s);
      if (matcher.find()) {
        if (matcher.group(1).equals("true")) {
          return s.replaceFirst("<META.+?>", "");
        }
      }
    }
    catch (Exception e) {
      Logger.getInstance(getClass().getName()).error(e);
    }
    return null;
  }
private @NlsSafe @Nullable String getDocumentation(String name, String type)