public UNode toDoc() {
        // Root node is called "doc".
        UNode result = UNode.createMapNode("doc");
        
        // Each child of "doc" is a simple VALUE node.
        for (String fieldName : m_resultFields.keySet()) {
            // In XML, we want the element name to be "field" when the node name is "_ID".
            if (fieldName.equals(OBJECT_ID)) {
                result.addValueNode(fieldName, m_resultFields.get(fieldName), "field");
            } else {
                result.addValueNode(fieldName, m_resultFields.get(fieldName));
            }
        }
        return result;
    }
public UNode toDoc ( ) { UNode result = UNode . createMapNode ( "doc" ) ; for ( String fieldName : m_resultFields . keySet ( ) ) { if ( fieldName . equals ( OBJECT_ID ) ) { result . addValueNode ( fieldName , m_resultFields . get ( fieldName ) , "field" ) ; } else { result . addValueNode ( fieldName , m_resultFields . get ( fieldName ) ) ; } } return result ; }
Serialize this ObjectResult into a UNode tree. The root node is called "doc".

@return  This object serialized into a UNode tree.