private static String firstOrEmpty(@NotNull NodeList list) {
    Node first = list.item(0);
    return first != null ? first.getTextContent() : "";
  }
private static String firstOrEmpty(@NotNull NodeList list)