private function instantiateEngine()
    {
        $arguments = $this->getArguments();
        $engine = null;
        switch (strtolower($arguments['flavour'])) {
            case 'goldilocks':
                $engine = new GoldilocksRenderingEngine();
                break;
                
            case 'xhtml':
                $engine = new XhtmlRenderingEngine();
                break;
        }
        
        if ($arguments['xmlbase'] === 'process') {
            $engine->setXmlBasePolicy(AbstractMarkupRenderingEngine::XMLBASE_PROCESS);
        } elseif ($arguments['xmlbase'] === 'keep') {
            $engine->setXmlBasePolicy(AbstractMarkupRenderingEngine::XMLBASE_KEEP);
        } elseif ($arguments['xmlbase'] === 'ignore') {
            $engine->setXmlBasePolicy(AbstractMarkupRenderingEngine::XMLBASE_IGNORE);
        }
        
        if ($arguments['document'] === true) {
            $engine->setStylesheetPolicy(AbstractMarkupRenderingEngine::STYLESHEET_SEPARATE);
        }
        
        if ($arguments['csshierarchy'] === true) {
            $engine->setCssClassPolicy(AbstractMarkupRenderingEngine::CSSCLASS_ABSTRACT);
        }
        
        return $engine;
    }