             // unwrap XObjStrings to their naked value
             if (obj.value != null || encodeNullElements)
             {
-                newNode = encodeValue(obj.value, qname, parentNode);
+                newNode = encodeValue(obj.value, qname, parentNode,true,false,false,propName);
             }
             else
             {

                    continue;
                
                var propQName:XObjQName = new XObjQName(null, null, fieldName);
                encodeValue(obj[fieldName], propQName, myElement, recurse, XObjMetadata.isPropByRef(classInfo, fieldName));
            }
        }
        else if (typeType == XObjXMLEncoder.IXOBJ_COLLECTION
            || typeType == XObjXMLEncoder.ARRAY_TYPE)
        {
            // link us into the heirarchy so that namespaces
            // will be resolved up the chain correctly
            parentNode.appendChild(myElement);
            setAttributes(myElement, obj);
            myElement.setName(XObjUtils.encodeElementTag(qname, myElement));
            
            // encode array elements
            for (var j:int=0; j < obj.length; j++)
            {
                var localName:String = "item";  //assume item unless told otherwise
                var member:* = obj[j];
                
                // force use of item for local name if simpleEncoderCompatible is true
                if (!simpleEncoderCompatible)
                {
                    // look up the right qname to use
                    if (obj is IXObjCollection)
                    {
                        localName = (obj as IXObjCollection).elementTagForMember(member);
                    }
                    else
                    {
                        // do we have meta?
                        var meta:XObjMetadata = XObjMetadata.getMetadata(obj, false);
                        if (meta && meta.arrayEntryTag)
                            localName = meta.arrayEntryTag;
                        else
                            localName = tagForType(member);
                    }
                }
                
                qname = new XObjQName(null, null, localName);
                
                if (XObjUtils.isByReference(obj))
                    encodeReference(member, qname, myElement);
                else
                    encodeValue(member, qname, myElement, recurse);
            }
        }
        else // must be simple type
        {

                                           qname:XObjQName, 
                                           parentNode:XML, 
                                           recurse:Boolean=true, 
                                           referenceOnly:Boolean=false,
                                           propName:String=null):XML
    {
        var myElement:XML;
        
