public function renderXml($data=null)
    {
        $this->beforeRender($data);
        
        $this->response = $this->response->withHeader('Content-Type', 'application/xml;charset=utf-8');
        
        $string = XmlFormatter::encode($this->responseData()->all());
        
        return static::renderText($string);
    }