--- XMLElement.php-orig	2012-09-28 21:44:52.755289395 +0200
+++ XMLElement.php	2012-09-28 23:01:43.147289691 +0200
@@ -259,7 +259,10 @@
       * Render the content, with special characters escaped
       *
       */
-      $r .= htmlspecialchars($this->content, ENT_NOQUOTES );
+      if(strpos($this->content, '<![CDATA[')===0 && strrpos($this->content, ']]>')===strlen($this->content)-3)
+        $r .= '<![CDATA[' . str_replace(']]>', ']]]]><![CDATA[>', substr($this->content, 9, -3)) . ']]>';
+      else
+        $r .= htmlspecialchars($this->content, ENT_NOQUOTES );
     }
     return $r;
   }
