public function getXML()
 {
     $this->printHeader = false;
     $this->printFooter = false;
     if ($this->aid != null) {
         $app = new App($this->aid);
     } else {
         $apps = AppUtil::getAppsByUid($this->user->id);
         $app = $apps['0'];
     }
     $reports = ReportUtil::getReportsByAid($app->id, $this->startDate, $this->endDate);
     fb("reports", $reports);
     $new_reports = $this->collapseReport($reports);
     fb("nr", $new_reports);
     $this->smarty->assign('reports', $new_reports);
     $this->smarty->assign('nets', $reports['nets']);
     $this->smarty->assign('dates', $new_reports['dates']);
     $this->smarty->assign('metric', 'impressions');
     return $this->smarty->fetch('../tpl/www/reports/applicationReportsXML.tpl');
 }