xml publish stop garbage

Here i will publish Cakephp tips for bakers.
The first one comes;
 
function productxml(){
       
        Configure::write('debug', 0);
       
        $this->set('products',$this->Product->findall());
        $this->RequestHandler->respondAs('xml');
 
        $this->viewPath .= '/xml';
 
        $this->layoutPath = 'xml';
 }
 
When you produce xml output, if debug level higher then 0, all output would become garbage. Hint is;
Configure::write('debug', 0);
Use this at the beginning of your function and you'll have only pure xml output.