     internal function encodeValue(obj:Object, q:*, parentNode:XMLNode, recurse:Boolean=true, referenceOnly:Boolean=false, isRoot:Boolean=false):XMLNode
     {
         var qname:XObjQName = new XObjQName();
-        
+
         if (q is XObjQName)
             qname = q;
         else if (q is QName)

                return internal_encodeValue(obj, qname, parentNode, false);
            }
            else
                return internal_encodeValue(obj, qname, parentNode);
        }
        else
        {

            parentNode.parentNode = xmlDocument;
        }
        
        encodeValue(obj, qname, parentNode, true, referenceOnly, true);
        
        // dump the recursionMap at the end
        recursionMap = null;
        
        return xmlDocument;
    }
