public static FileIncludeLoader <TItem> Serialize(FileIncludeLoader <TItem> instance, SimpleXmlSerializerBase serializer) { instance = instance ?? throw new ArgumentNullException(nameof(instance)); // Skip root element when reading serializer.ProcessEnterChildOnRead(); serializer.ProcessCollection( instance.Items, itemSerializer => serializer.CreateByKnownInheritors <TItem>( serializer.CurrentXmlElement.Name, itemSerializer )); return(instance); }