question: private static final void writeValueXml ( Object v , String name , XmlSerializer out , WriteMapCallback callback ) throws XmlPullParserException , IOException { String typeStr ; if ( v == null ) { out . startTag ( null , "null" ) ; if ( name != null ) { out . attribute ( null , "name" , name ) ; } out . endTag ( null , "null" ) ; return ; } else if ( v instanceof String ) { out . startTag ( null , "string" ) ; if ( name != null ) { out . attribute ( null , "name" , name ) ; } out . text ( v . toString ( ) ) ; out . endTag ( null , "string" ) ; return ; } else if ( v instanceof Integer ) { typeStr = "int" ; } else if ( v instanceof Long ) { typeStr = "long" ; } else if ( v instanceof Float ) { typeStr = "float" ; } else if ( v instanceof Double ) { typeStr = "double" ; } else if ( v instanceof Boolean ) { typeStr = "boolean" ; } else if ( v instanceof byte [ ] ) { writeByteArrayXml ( ( byte [ ] ) v , name , out ) ; return ; } else if ( v instanceof int [ ] ) { writeIntArrayXml ( ( int [ ] ) v , name , out ) ; return ; } else if ( v instanceof long [ ] ) { writeLongArrayXml ( ( long [ ] ) v , name , out ) ; return ; } else if ( v instanceof double [ ] ) { writeDoubleArrayXml ( ( double [ ] ) v , name , out ) ; return ; } else if ( v instanceof String [ ] ) { writeStringArrayXml ( ( String [ ] ) v , name , out ) ; return ; } else if ( v instanceof boolean [ ] ) { writeBooleanArrayXml ( ( boolean [ ] ) v , name , out ) ; return ; } else if ( v instanceof Map ) { writeMapXml ( ( Map ) v , name , out ) ; return ; } else if ( v instanceof List ) { writeListXml ( ( List ) v , name , out ) ; return ; } else if ( v instanceof Set ) { writeSetXml ( ( Set ) v , name , out ) ; return ; } else if ( v instanceof CharSequence ) { out . startTag ( null , "string" ) ; if ( name != null ) { out . attribute ( null , "name" , name ) ; } out . text ( v . toString ( ) ) ; out . endTag ( null , "string" ) ; return ; } else if ( callback != null ) { callback . writeUnknownObject ( v , name , out ) ; return ; } else { throw new RuntimeException ( "writeValueXml: unable to write value " + v ) ; } out . startTag ( null , typeStr ) ; if ( name != null ) { out . attribute ( null , "name" , name ) ; } out . attribute ( null , "value" , v . toString ( ) ) ; out . endTag ( null , typeStr ) ; }
target:  Flatten an object's value into an XmlSerializer.  The value can later be read back with readThisValueXml(). Currently supported value types are: null, String, Integer, Long, Float, Double Boolean, Map, List.