xml serialization in a separate thread