> This seems to me to break the principle of encapsulation - I have to expose a lot of the internal data on my class just to provide a representation for it. Not really. Whatever approach you choose, you *are* exposing the **XML data and its structure** in public, so even if you do not write any getters and setters, changing the fields and their structure will not be easy at a later point in time. Moreover, you should consider not to implement this "manually". There are some reflection based libraries (like [XStream][1]) which can do an Xml serialization / deserialization for you. They work fine with private attributes, so no need to write any additional getters and setters. [1]: http://x-stream.github.io/tutorial.html