private void saveAvailablePluginsInfo() {
        //  XML to store in the file
        Element xml = docFactory.createDocument().addElement("available");
        for (AvailablePlugin plugin : availablePlugins.values()) {
            Element component = xml.addElement("plugin");
            component.addAttribute("name", plugin.getName());
            component.addAttribute("latest", plugin.getVersion() != null ? plugin.getVersion().getVersionString() : null);
            component.addAttribute("releaseDate", plugin.getReleaseDate());
            component.addAttribute("changelog", plugin.getChangelog() != null ? plugin.getChangelog().toExternalForm() : null );
            component.addAttribute("url", plugin.getDownloadURL() != null ? plugin.getDownloadURL().toExternalForm() : null );
            component.addAttribute("author", plugin.getAuthor());
            component.addAttribute("description", plugin.getDescription());
            component.addAttribute("icon", plugin.getIcon() != null ? plugin.getIcon().toExternalForm() : null );
            component.addAttribute("minServerVersion", plugin.getMinServerVersion() != null ? plugin.getMinServerVersion().getVersionString() : null);
            component.addAttribute("priorToServerVersion", plugin.getPriorToServerVersion() != null ? plugin.getPriorToServerVersion().getVersionString() : null);
            component.addAttribute("readme", plugin.getReadme() != null ? plugin.getReadme().toExternalForm() : null );
            component.addAttribute( "licenseType", plugin.getLicense() );
            component.addAttribute("fileSize", Long.toString(plugin.getFileSize()));
        }
        // Write data out to conf/available-plugins.xml file.
        try {
            // Create the conf folder if required
            final Path confDir = JiveGlobals.getHomePath().resolve("conf");
            if (!Files.exists(confDir)) {
                Files.createDirectory(confDir);
            }

            final Path availablePlugins = confDir.resolve("available-plugins.xml");

            final String xmlString;
            try (final StringWriter out = new StringWriter()) {
                final XMLWriter writer = new XMLWriter(out, OutputFormat.createPrettyPrint());
                writer.write(xml);
                writer.flush();
                xmlString = out.toString();
                writer.close();
            }

            // Delete the content of the old available-plugins.xml file if it exists.
            Files.writeString(availablePlugins,
                xmlString,
                StandardCharsets.UTF_8,
                StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING);
        }
        catch (Exception e) {
            Log.error("A problem occurred when trying to save available plugins.", e);
        }
    }
Saves to conf/available-plugins.xml the list of plugins that are available
at igniterealtime.org.
xmppserver/src/main/java/org/jivesoftware/openfire/update/UpdateManager.java