Getting error as undefined variable on sitemap.xml file in CodeIgniter PHP

     

I implemented sitemap.xml file. When I click on the link it is showing an error message.


Error:


    http://www.xxxx.com/  1.0      
  

A PHP Error was encountered

  

Severity: Notice

  

Message: Undefined variable: data

  

Filename: views/sitemap.php

  

Line Number: 9

  
  
  

A PHP Error was encountered

  

Severity: Warning

  

Message: Invalid argument supplied for foreach()

  

Filename: views/sitemap.php

  

Line Number: 9

  
  
  

Here is my code.


Controller:


Class Seo extends CI_Controller {
function sitemap()  {
$data = "";//select urls from DB to Array   header("Content-Type: text/xml;charset=iso-8859-1");   $this->load->view("sitemap"$data);  }  }  

View:


  ' ?>          1.0