_params); if ($el instanceof \Rails\ActiveRecord\Collection) { $this->_xml = new \Rails\ActionView\Xml(); $root = $this->_params['root']; $this->_xml->instruct(); $this->_xml->$root([], function() use ($el) { foreach ($el as $model) { $model->toXml(['builder' => $this->_xml, 'skip_instruct' => true]); } }); } else $this->_xml = new \Rails\Xml\Xml($el, $this->_params); } public function _print_view() { return $this->_xml->output(); } }