public function process(Template $template, Layout $layout = null) {
        $content = $template->process($this->rules, $this->data);
        
        if (!is_null($layout)) {
        	$this->data[] = $content;
        	$content = $layout->process($this->rules, $this->data);
        }
        
        return $content;
    }