public function processConfig(Plugin $plugin, &$log = '', $xml = false)
    {
        if (!$xml)
            $xml = $this->loadXML($plugin->Path);

        if(!$xml)
            throw new Exception('Missing plugin.xml file for plugin ['.$plugin->Slug.']');

        //process config.php
        if (!empty($xml->config)) {
            $snippet = trim(strval($xml->config));

            if ($this->ConfigService->insertSnippet($plugin, $snippet, $log))
                $log .= "Appended plugin config snippet to config file.\n\n";
        }
    }