question: public static final void writeMapXml ( Map val , String name , XmlSerializer out ) throws XmlPullParserException , IOException { if ( val == null ) { out . startTag ( null , "null" ) ; out . endTag ( null , "null" ) ; return ; } Set s = val . entrySet ( ) ; Iterator i = s . iterator ( ) ; out . startTag ( null , "map" ) ; if ( name != null ) { out . attribute ( null , "name" , name ) ; } while ( i . hasNext ( ) ) { Map . Entry e = ( Map . Entry ) i . next ( ) ; writeValueXml ( e . getValue ( ) , ( String ) e . getKey ( ) , out ) ; } out . endTag ( null , "map" ) ; }
target:  Flatten a Map into an XmlSerializer.  The map can later be read back with readThisMapXml().