Make YamlDocument and YamlStream serializable.