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");
}

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" ) ; }
flatten a map into an xmlserializer . the map can later be read back with readthismapxml ( ) .
