function getManifest($dir)
    {
        $file = $dir . '/jfusion.xml';
        $this->installer->setPath('manifest', $file);
        // If we cannot load the xml file return null

	    $xml = JFusionFramework::getXml($file);

		if (!($xml instanceof SimpleXMLElement) || ($xml->getName() != 'extension')) {
            // Free up xml parser memory and return null
            unset($xml);
            $xml = null;
        } else {
            /**
             * Check that the plugin is an actual JFusion plugin
             */
            $type = $this->getAttribute($xml, 'type');

            if ($type !== 'jfusion') {
                //Free up xml parser memory and return null
                unset ($xml);
                $xml = null;
            }
        }

        // Valid manifest file return the object
        return $xml;
    }