I have a composite object that was generated from an xml schema that I need to populate with data from a database.
The generated code doesn't enforce the schema's rules regarding required elements, max occurances, etc. I'd like to create a class (or collection of classes) to help fill in the composite object and ensure when its serialized the resulting xml will validate against the schema.
I've looked into the various creational design patterns and the Builder Pattern seems like it might work for this but having never used it I'm just not sure.
Is the Builder pattern the best way or am I off track? Is there a better way to go about this?