<?xml version="1.0" encoding="UTF-8"?>
  
<urlset
      xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
            http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"> 
             
<? 
//level 0 
$db->where("contentTitle !='nieuwe pagina'");
$db->orderBy("contentID", "Desc");
$content = $db->ObjectBuilder()->getOne("content","contentLastupdate"); 

?>
<url>
	
</url>
<url>
  <loc><?echo $siteURL;?>/</loc>
  <lastmod><?echo strtok($content->contentLastupdate, " ");?></lastmod> 
  <changefreq>monthly</changefreq>
  <priority>1.00</priority>
</url> 	
<?
   

//level 1
$db->where("contentHide !='1'");
$db->where("contentStealth !='1'");
$db->where("contentTitle !='nieuwe pagina'");
$db->where("contentPublish < ".$timestamp);
$db->where("contentParent", 1);
$db->orderBy("contentID", "Asc");
$content = $db->ObjectBuilder()->get("content");  
foreach ($content as $content ) 
{  
	?>
<url>
	
</url>
<url>
  <loc><?echo $siteURL;?>/<?echo $content->contentURLtitle;?>/</loc>
  <lastmod><?echo strtok($content->contentLastupdate, " ");?></lastmod>
  <changefreq>weekly</changefreq>
  <priority>1.00</priority>
</url>
<?



	
//level 2 
	
	$db->where("contentHide !='1'");
	$db->where("( contentStealth !='1'  OR contentStealth IS NULL )");
	$db->where("contentTitle !='nieuwe pagina'");
	$db->where("contentPublish < ".$timestamp);
	$db->where("contentParent", $content->contentID);
	$db->orderBy("contentID", $content->contentOrder);
	$content_l2 = $db->ObjectBuilder()->get("content");  
	foreach ($content_l2 as $content_l2 )  
	{   
		?>
<url>
  <loc><?echo $siteURL;?>/<?echo $content->contentURLtitle;?>/<?echo $content_l2->contentURLtitle;?>/</loc>
  <lastmod><?echo strtok($content_l2->contentLastupdate, " ");?></lastmod>
  <changefreq>weekly</changefreq>
  <priority>0.90</priority>
</url>


		
<? 
//level 3
 
	$db->where("contentHide !='1'");
	$db->where("( contentStealth !='1'  OR contentStealth IS NULL )");
	$db->where("contentTitle !='nieuwe pagina'");
	$db->where("contentPublish < ".$timestamp);
	$db->where("contentParent",$content_l2->contentID);
	$db->orderBy("contentID", $content_l2->contentOrder);
	$content_l3 = $db->ObjectBuilder()->get("content");   
	foreach ($content_l3 as $content_l3 )  
	{   
		?>
<url> 
  <loc><?echo $siteURL;?>/<?echo $content->contentURLtitle;?>/<?echo $content_l2->contentURLtitle;?>/<?echo $content_l3->contentURLtitle;?>/</loc>
  <lastmod><?echo strtok($content_l3->contentLastupdate, " ");?></lastmod>
  <changefreq>weekly</changefreq>
  <priority>0.80</priority>
</url>  
 <?


  	
	} 
	 
	

	}	 	 

}

?>
</urlset>