descr = new PluginDescriptorModel(root);
if (root.getName().equals("plugin")) { descr = new PluginDescriptorModel(root); } else if (root.getName().equals("fragment")) { descr = new FragmentDescriptorModel(root); } else { throw new BuildException("Unknown root tag " + root.getName()); }
    protected PluginDescriptorModel readDescriptor(File descriptor)    {        final PluginDescriptorModel descr;        try {            final XMLElement root = new XMLElement(new Hashtable(), true, false);            try {                final FileReader r = new FileReader(descriptor);                try {                    root.parseFromReader(r);                } finally {                    r.close();                }            } catch (IOException ex) {                throw new BuildException("Building " + descriptor + " failed", ex);            } catch (XMLParseException ex) {                throw new BuildException("Building " + descriptor + " failed", ex);            }            descr = new PluginDescriptorModel(root);        } catch (PluginException ex) {            ex.printStackTrace();            throw new BuildException("Building " + descriptor + " failed", ex);        }                        return descr;    }