As discussed in OpenAPITools/openapi-generator#3474 it would be awesome if JsonNullable would serialize correctly to XML as well. IIUC most of the heavy machinery is already present in this package and it'd only be necessary to implement the custom XML serializer which would look much like the custom JSON serializer.