Data class inheritance

Ok, I understand you, then I’ll have to use this

object Xml {

    ...

    fun <T> copy(value: Any, clazz: Class<T>): T = deserialize(serialize(value), clazz)
}

Thanks for the help.