If you want to do this kind of thing, I suggest that you take a good look at the Eclipse Modelling Framework (EMF).
The EMF toolset can take an XSD and use it to extract an EMF model and then generate Java classes. You can modify the generated classes and provided you follow a simple rule, your modifications will not be lost when you change the XSD / Model and regenerate the classes.
Each modifiable member declaration in the generated code is preceded by a Java comment which marks the member as generated. If you want to modify a member, you remove this comment and make your changes. Next time you regenerate, the generator performs a member by member comparison of the old and new versions of each class, looking for members whose signatures match, and updating them depending on the presence of the "generated" marker comments in the "old" version. This works surprisingly well. You occasionally have to do a bit of manual tidyup (e.g. to remove imports that are no longer required) but provided you remembered to delete the marker comments you won't lose your changes. (But it is a good idea to check in the generated code anyway ... if only to version control your changes!)
If you don't like the code that EMF generates, you there are many code generation options you can tweak in your Model's associated GenModel, or you can modify or replace the JET templates that comprise the EMF source code generator.
In addition to generating the classes that represent your XML in memory, EMF gives you an XML serializer / deserializer and an extensible / tailorable GUI based editor for your data structures. Related EMF projects include facilities for persisting your data into databases, augmenting your Model with validation rules, transactions, queries and comparisons. And there much more in the related Eclipse Modelling projects.
There is a whole stack of white-papers, tutorials and other documentation on the EMF documents page