There is something like, but not quite like JAXB. Similar is expressed by Allon Guralnek and Bruno Conde. The difference is deserialization. Using XmlSerializer you must specify the type. The type can come from the XSD file, the XML Schema, which is processed using the XSD.EXE tool. The tool creates a cs file with partial classes for each specific type in the XML schema. It is convenient to use.
But you cannot use derserializer in XmlSerilaizer unless you have a type for valid xml. The script may look like this. You receive xml messages from the message queue. You can get any of the types defined in the XML schema. With JAXB, you wrap xml into an object and use the getClass property to determine what type it is. I have not found a similar way to do this in C #.
source share