Added serialization and XML stuff.