code: @SuppressWarnings("unchecked")
      public static Collection<PluginDefinition> loadFromXmlPluginPackageDefinitions(final ClassLoader cl, final InputStream in)
              throws PluginConfigurationException {
  
          List<PluginDefinition> res = new ArrayList<PluginDefinition>();
  
          DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
  
          Document document;
  
          try {
              DocumentBuilder loader = factory.newDocumentBuilder();
              DOMReader reader = new DOMReader();
  
              document = reader.read(loader.parse(in));
          } catch (Exception e) {
              throw new PluginConfigurationException(e.getMessage(), e);
          }
  
          Element plugins = document.getRootElement();
  
          // TODO : validate against schema
  
          // iterate through child elements of root
          for (Iterator<Element> i = plugins.elementIterator(); i.hasNext();) {
              res.add(parsePluginDefinition(cl, i.next()));
          }
  
          return res;
      }
docs: Loads the plugins definitions from the jnrpe_plugins.xml file.
  
  @param cl Classloader to be used to load classes
  @param in InputStream to the jnrpe_plugins.xml file
  @return a collection of all the declared plugins
  @throws PluginConfigurationException on any error reading the plugin configuration