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 ; }
Serialize this ObjectResult into a UNode tree . The root node is called doc .