         }
     }
     
-    protected function internal_encodeValue(obj:Object, 
+    internal function internal_encodeValue(obj:Object, 
                                             qname:XObjQName, 
                                             parentNode:XMLNode, 
                                             recurse:Boolean=true, 

            parentNode.parentNode = xmlDocument;
        }
        
        encodeValue(obj, qname, parentNode);
        
        return xmlDocument;
    }
    
    public function encodeReference(obj:Object, q:*, parentNode:XMLNode):XMLNode
    {
        return encodeValue(obj, q, parentNode, false, true);
    }
    
    public function encodeValue(obj:Object, q:*, parentNode:XMLNode, recurse:Boolean=true, referenceOnly:Boolean=false):XMLNode
    {
        var qname:XObjQName = new XObjQName();
        

        else if (recurse)
        {
            if (obj is IXObjReference && 
                    ((obj as IXObjReference).isByReference || obj["id"] != null))
            {
                // don't recurse refs that have IDs since this means they are
                // *by reference* uses relationships, not strict containment
