Index: kernel/classes/datatypes/ezxmltext/ezxmlinputparser.php
===================================================================
--- kernel/classes/datatypes/ezxmltext/ezxmlinputparser.php	(revision 24908)
+++ kernel/classes/datatypes/ezxmltext/ezxmlinputparser.php	(working copy)
@@ -726,7 +726,7 @@
         $text = str_replace( '&apos;', "'", $text );
         $text = str_replace( '&quot;', '"', $text );
         $text = str_replace( '&amp;', '&', $text );
-        $text = str_replace( '&nbsp;', ' ', $text );
+        $text = str_replace( '&nbsp;&nbsp;', '&nbsp;', $text );
         return $text;
     }
 
Index: kernel/classes/datatypes/ezxmltext/handlers/output/ezxhtmlxmloutput.php
===================================================================
--- kernel/classes/datatypes/ezxmltext/handlers/output/ezxhtmlxmloutput.php	(revision 24908)
+++ kernel/classes/datatypes/ezxmltext/handlers/output/ezxhtmlxmloutput.php	(working copy)
@@ -556,11 +556,12 @@
         if ( $element->parentNode->nodeName != 'literal' )
         {
             $text = htmlspecialchars( $element->textContent );
+            $text = str_replace ( '&amp;nbsp;', '&nbsp;', $text);
             // Get rid of linebreak and spaces stored in xml file
-            $text = preg_replace( "#[\n]+#", "", $text );
+            $text = str_replace( "\n", '', $text );
 
             if ( $this->AllowMultipleSpaces )
-                $text = preg_replace( "#  #", " &nbsp;", $text );
+                $text = str_replace( '  ', ' &nbsp;', $text );
             else
                 $text = preg_replace( "# +#", " ", $text );
 
