                     {
                         str = newline(str, indent);
                         prop = properties[j];
+                        
                         if (isArray)
                             str += "[";
-                        str += prop.toString();
+                        else if (isDict)
+                            str += "{";
+
+                    
+                        if (isDict)
+                        {
+                            // in dictionaries, recurse on the key, because it can be a complex object
+                            str += internalToString(prop, indent, refs,
+                                                    namespaceURIs, exclude);
+                        }
+                        else
+                        {
+                            str += prop.toString();
+                        }
+                        
                         if (isArray)
                             str += "] ";
+                        else if (isDict)
+                            str += "} = ";
                         else
                             str += " = ";
+                        
                         try
                         {
-                            str += internalToString(
-                                        value[prop], indent, refs, namespaceURIs, 
-                                        exclude);
+                            // print the value
+                            str += internalToString(value[prop], indent, refs,
+                                                    namespaceURIs, exclude);
                         }
                         catch(e:Error)
                         {

                    }

                    var isArray:Boolean = value is Array;
                    var prop:*;
                    indent += 2;
                    

     *  @return An Object containing the following properties:
     *  <ul>
     *    <li><code>name</code>: String containing the name of the class;</li>
     *    <li><code>properties</code>: Sorted list of the property names of the specified object,
     *    or references to the original key if the specified object is a Dictionary</li>
     *  </ul>
    */
    public static function getClassInfo(obj:Object,
