     /**
      *  @private
      */
-    private function importStringMarkup(markup:String):TextFlow
-    {
-        markup = '<TextFlow xmlns="http://ns.adobe.com/textLayout/2008">' +
-                 markup +
-                 '</TextFlow>';
-        
-        return TextFilter.importToFlow(markup, TextFilter.TEXT_LAYOUT_FORMAT);
-    }
-    
-    /**
-     *  @private
-     */
-    private function importXMLMarkup(markup:XML):TextFlow
-    {
-        return TextFilter.importToFlow(markup, TextFilter.TEXT_LAYOUT_FORMAT);
+    private function createTextFlowFromMarkup(markup:Object):TextFlow
+    {
+        // The whiteSpaceCollapse format determines how whitespace
+        // is processed when markup is imported.
+		staticCharacterFormat.whiteSpaceCollapse =
+            getStyle("whiteSpaceCollapse");
+		staticConfiguration.textFlowInitialCharacterFormat =
+            staticCharacterFormat;
+		staticImportExportConfiguration.textFlowConfiguration =
+            staticConfiguration; 
+
+        if (markup is String)
+        {
+            markup = '<TextFlow xmlns="http://ns.adobe.com/textLayout/2008">' +
+                     markup +
+                     '</TextFlow>';
+        }
+        
+        return TextFilter.importToFlow(markup, TextFilter.TEXT_LAYOUT_FORMAT,
+                                       staticImportExportConfiguration);
+    }
+    
+    /**
+     *  @private
+     */
+    private function createTextFlowFromChildren(children:Array):TextFlow
+    {
+        var textFlow:TextFlow = new TextFlow();
+
+        // The whiteSpaceCollapse format determines how whitespace
+        // is processed when the children are set.
+        staticCharacterFormat.whiteSpaceCollapse =
+            getStyle("whiteSpaceCollapse");
+        textFlow.hostCharacterFormat = staticCharacterFormat;
+
+        textFlow.mxmlChildren = children;
+
+        return textFlow;
     }
 
     /**

import flash.display.DisplayObjectContainer;
import flash.geom.Rectangle;

import flashx.textLayout.conversion.ITextImporter;
import flashx.textLayout.conversion.TextFilter;
import flashx.textLayout.elements.FlowElement;
import flashx.textLayout.elements.ParagraphElement;
import flashx.textLayout.elements.SpanElement;

            }
            else if (_content is Array)
            {
                textFlow = createTextFlowFromChildren(_content as Array);
            }
            else if (_content is FlowElement)
            {
                textFlow = createTextFlowFromChildren([ _content ]);
            }
	        else if (_content is String || _content is XML)
            {
                textFlow = createTextFlowFromMarkup(_content);
            }
            else if (_content == null)
            {
