The real trick was this one liner, had to look at the api documentation and try a couple of things:
public function beforeRender() {
if(empty($this->RequestHandler->request->params['ext'])) {
$this->RequestHandler->renderAs($this, 'xml');
}
}