One thing that I got bitten by several times in the past is that you need to use a Schema file together with XML parsing in order to define whether an attribute should be serialized as an attribute of a tag or as a subtag.
In order to do so, you need to add a schema to the XmlObjectCache’s current singleton and make the parser use that schema. I’m not sure I’ve found the correct way to do so, and if so, I’m not sure how you would achieve that instances of some class can be mapped differently in two different contexts.
Say we have a class named Customer that should be serialized with all its attributes in context of a full crm export file, but in context of an export for envelope printing, we need to write different tags for the same class.
Maybe somebody has some notes on the topic they can share…