docs: @Restricted(NoExternalUse.class)
      public void writeConfigDotXml(OutputStream os) throws IOException {
          checkPermission(EXTENDED_READ);
          XmlFile configFile = getConfigFile();
          if (hasPermission(CONFIGURE)) {
              IOUtils.copy(configFile.getFile(), os);
          } else {
              String encoding = configFile.sniffEncoding();
              String xml = FileUtils.readFileToString(configFile.getFile(), encoding);
              Matcher matcher = SECRET_PATTERN.matcher(xml);
              StringBuffer cleanXml = new StringBuffer();
              while (matcher.find()) {
                  if (Secret.decrypt(matcher.group(1)) != null) {
                      matcher.appendReplacement(cleanXml, ">********<");
                  }
              }
              matcher.appendTail(cleanXml);
              org.apache.commons.io.IOUtils.write(cleanXml.toString(), os, encoding);
          }
      }