I think that XmlSerializationVisitor::addNamespaceAttributes should be called at https://github.com/ajgarlag/serializer/blob/xml-namespaces/src/JMS/Serializer/XmlSerializationVisitor.php#L305 too, but there is no access to the ClassMetadata.

Suggestions are appreciated.