Flat files and relational databases give us a mechanism to serialize structured data. XML is superb for serializing un-structured tree-like data.
But many problems are b
On a less academic, more practical note, in CubicTest we use Xstream (Java) to serialize tests to and from xml. Xstream handles graph-structured object relations, so you might learn a thing or two from looking at it's source and the resulting xml. You're right about the ugly part though, the generated xml files don't look pretty.