static String getElementValue( Path pluginDir, String xpath )
    {
        if ( pluginDir == null )
        {
            return null;
        }
        try
        {
            final Path pluginConfig = pluginDir.resolve( "plugin.xml" );
            if ( Files.exists( pluginConfig ) )
            {
                final Document pluginXML = SAXReaderUtil.readDocument( pluginConfig.toFile() );
                final Element element = (Element) pluginXML.selectSingleNode( xpath );
                if ( element != null )
                {
                    return element.getTextTrim();
                }
            }
        }
        catch ( Exception e )
        {
            Log.error( "Unable to get element value '{}' from plugin.xml of plugin in '{}':", xpath, pluginDir, e );
            if (e instanceof InterruptedException) {
                Thread.currentThread().interrupt();
            }

        }
        return null;
    }
Returns the value of an element selected via an xpath expression from
a Plugin's plugin.xml file.

@param pluginDir the path of the plugin directory.
@param xpath     the xpath expression.
@return the value of the element selected by the xpath expression.
xmppserver/src/main/java/org/jivesoftware/openfire/container/PluginMetadataHelper.java