Protocol Buffers
Think about XML, but simpler and faster. With Protocol Buffers, you can set the structure of your data, serialize and pass from and to different data streams. The code uses class-like structure stored in a .proto file.
You might want to check it out. Protocol Buffers