Added a test for XML serialization. There seems to be a problem with the internal Scala representation of XML attributes, which means that an attribute can occur more than once, which causes parsing problems.