renderJson - how to renderXML?

i have that in function:
return $this->response->withJson($args);

now i what to do the same but with XML
what function like “withJson” in need to render my file to xml file?

We don’t have a short-cut for XML. you will have to write your own.

so how i can do a sitemap? without a package ?

Keeping a public sitemap would be up to the developer.

id somone need the code: (work with twig)

 protected function renderXML($template, $args = []) {
        //switch to XML file with Content-Type
        $this->view->render($this->response, $template . '.xml', $args);
        return $this->response->withHeader('Content-Type','text/xml');