docs: public static String extractXmlEncoding(String content) {
  
          String result = null;
          Matcher xmlHeadMatcher = XML_HEAD_REGEX.matcher(content);
          if (xmlHeadMatcher.find()) {
              String xmlHead = xmlHeadMatcher.group();
              Matcher encodingMatcher = XML_ENCODING_REGEX.matcher(xmlHead);
              if (encodingMatcher.find()) {
                  String encoding = encodingMatcher.group();
                  int pos1 = encoding.indexOf('=') + 2;
                  String charset = encoding.substring(pos1, encoding.length() - 1);
                  if (Charset.isSupported(charset)) {
                      result = charset;
                  }
              }
          }
          return result;
      }