DocumentManager serialization and deserialization