Added serialization to XML, some tests