Personally, I've found XML to usually be the best course of action. In my experience, it provides a flexible solution where I can add/remove parts of the document format with minimal code change. It also allows good flexibility for "optional" fields, which is always a plus. Lastly, XML reading and writing is included in the standard java api, so you don't "have" to add any additional dependencies to your project (although there are some significantly better XML reading/writing apis than the standard java api one).