public function toXHTML($options = array(), &$filtered = array()){

        $template = static::getTemplatePath().'/xhtml.item.tpl.php';

        // get the variables to use in the template
        $variables = $this->getAttributeValues();
        $variables['stylesheets'] = array();
        foreach($this->getStylesheets() as $stylesheet){
            $variables['stylesheets'][] = $stylesheet->getAttributeValues();
        }
        //additional css:
        if(isset($options['css'])){
            foreach($options['css'] as $css){
                $variables['stylesheets'][] = array('href' => $css, 'media' => 'all');
            }
        }

        //additional js:
        $variables['javascripts'] = array();
        $variables['js_variables'] = array();
        if(isset($options['js'])){
            foreach($options['js'] as $js){
                $variables['javascripts'][] = array('src' => $js);
            }
        }
        if(isset($options['js_var'])){
            foreach($options['js_var'] as $name => $value){
                $variables['js_variables'][$name] = $value;
            }
        }

        //user scripts
        $variables['user_scripts'] = $this->getUserScripts();

        $dataForDelivery = $this->getDataForDelivery();
        $variables['itemData'] = $dataForDelivery['core'];

        //copy all variable data into filtered array
        foreach($dataForDelivery['variable'] as $serial => $data){
            $filtered[$serial] = $data;
        }

        $variables['contentVariableElements'] = isset($options['contentVariableElements']) && is_array($options['contentVariableElements']) ? $options['contentVariableElements'] : array();
        $variables['tao_lib_path'] = isset($options['path']) && isset($options['path']['tao']) ? $options['path']['tao'] : '';
        $variables['taoQtiItem_lib_path'] = isset($options['path']) && isset($options['path']['taoQtiItem']) ? $options['path']['taoQtiItem'] : '';
        $variables['client_config_url'] = isset($options['client_config_url']) ? $options['client_config_url'] : '';

        $tplRenderer = new taoItems_models_classes_TemplateRenderer($template, $variables);

        $returnValue = $tplRenderer->render();

        return (string) $returnValue;
    }