Creates a serializable string for generic types that is XML serializable.

Encodes keys as element names and values as simple values with a type attribute that contains an XML type name. Complex names encode the type name with type='___namespace.classname' format followed by a standard xml serialized format. The latter serialization can be slow so it's not recommended to pass complex types if performance is critical.