Kotlin Serialization

This would be sensible. There is one caveat, versioning requires stateful serialization/deserialization. While stateful approaches have their limitations, a generic framework could support attaching state that then could be used later in the framework. Note that xml namespaces would also need support for state unless an underlying layer does the namespace management (like most parsers actually do, but for some specialised purposes access to this state is beneficial - for example if you need to refer to a namespace prefix in an attribute or text value (eg. an xpath query with namespace support)).