diff -aburN --exclude='CVS*' phpgwapi.org/inc/class.browser.inc.php phpgwapi/inc/class.browser.inc.php
--- phpgwapi.org/inc/class.browser.inc.php	2006-08-28 13:37:11.000000000 +0200
+++ phpgwapi/inc/class.browser.inc.php	2006-08-28 13:44:59.000000000 +0200
@@ -289,5 +289,20 @@
 				}
 			}
 		}
+		
+		/**
+		* Determine whether the browser is wml-capable or not
+		*/
+		function is_mobile()
+		{
+			if (stripos ( $_SERVER['HTTP_ACCEPT'], 'text/vnd.wap.wml' ))
+			{
+				return true;
+			}
+			else
+			{
+				return false;
+			}
+		}
 	}
 ?>
diff -aburN --exclude='CVS*' phpgwapi.org/inc/class.xslttemplates.inc.php phpgwapi/inc/class.xslttemplates.inc.php
--- phpgwapi.org/inc/class.xslttemplates.inc.php	2006-08-28 13:37:11.000000000 +0200
+++ phpgwapi/inc/class.xslttemplates.inc.php	2006-08-28 14:56:16.000000000 +0200
@@ -195,7 +195,13 @@
 			return $this->xmlvars;
 		}
 
-		function xsl_parse()
+		/**
+		* Parse the xsl-stylesheets
+		*
+		* @param boolean $wml_out set to true for wml-enabled browsers
+		*/
+
+		function xsl_parse($wml_out = false)
 		{
 			if( is_array($this->xslfiles) && count($this->xslfiles) > 0)
 			{
@@ -205,9 +211,18 @@
 				$this->xsldata .= '<!ENTITY nbsp "&#160;">'."\n";
 				$this->xsldata .= ']>'."\n";
 				$this->xsldata .= '<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">'."\n";
+
+				if(!$wml_out)
+				{	
 				$this->xsldata .= '<xsl:output method="html" version="1.0" encoding="utf-8" indent="yes" omit-xml-declaration="yes" standalone="yes" media-type="application/xml+xhtml"/>'."\n";
 				//FIXME Remove the line above and uncomment the one below once the main templates are converted or else it fscks validation
 				//$this->xsldata .= '<xsl:output method="html" version="1.0" encoding="utf-8" indent="yes" omit-xml-declaration="yes" doctype-public="-//W3C/DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" standalone="yes" media-type="application/xml+xhtml"/>'."\n";
+				}
+				else
+				{
+					$this->xsldata .= '<xsl:output method = "xml" encoding="utf-8"  doctype-public="-//WAPFORUM//DTD WML 1.3//EN" doctype-system="http://www.wapforum.org/DTD/wml13.dtd" />'."\n";				
+
+				}
 				$this->xsldata .= '<xsl:template match="/">'."\n";
 				$this->xsldata .= "\t".'<xsl:apply-templates select="PHPGW"/>'."\n";
 				$this->xsldata .= '</xsl:template>'."\n";
@@ -261,11 +276,18 @@
 		function parse($parsexsl = True, $parsexml = True)
 		{
 			$output_header = !(isset($GLOBALS['phpgw_info']['flags']['noframework']) && $GLOBALS['phpgw_info']['flags']['noframework']);
+			
+			// Determine whether the browser is wml-capable or not
+			$wml_out = execMethod('phpgwapi.browser.is_mobile');
+			
+			if(!$wml_out)
+			{
 			$GLOBALS['phpgw']->common->phpgw_header($output_header);
+			}
 
 			if($parsexsl)
 			{
-				$this->xsl_parse();
+				$this->xsl_parse($wml_out);
 			}
 			if($parsexml)
 			{
