public void SerializeInMemory()
        {
            var reader = XmlReader.Create("SampleMedia.rss");
            var formatter = new MediaRssFeedFormatter(new MediaRssFeed());
            formatter.ReadFrom(reader);

            var settings = new XmlWriterSettings
            {
                NewLineOnAttributes = true,
                NamespaceHandling = NamespaceHandling.OmitDuplicates,
                CloseOutput = true,
                Indent = true
            };

            var writer = XmlWriter.Create("TestOutput.rss", settings);
            formatter.WriteTo(writer);

            Debug.WriteLine(writer.ToString());
            writer.Close();
        }
        public void CreateNewRssFile()
        {
            var myFeed = new MediaRssFeed
            {
                Copyright = new TextSyndicationContent("Copyright 2010-2020 @ Because it looks good"),
                Description = new TextSyndicationContent("This is a sample media feed"),
                Title = new TextSyndicationContent("Hello Media Feed World!")
            };

            var feedItems = new List<MediaRssItem>();

            var item = new MediaRssItem();
            var rating = new StarRating {Min = 1, Max = 5};
            item.OptionalElements.CommunityNode = new Community { Rating = rating};

            feedItems.Add(item);

            myFeed.Items = feedItems;

            var settings = new XmlWriterSettings
            {
                NewLineOnAttributes = true,
                NamespaceHandling = NamespaceHandling.OmitDuplicates,
                CloseOutput = true,
                Indent = true
            };

            using (var writer = XmlWriter.Create("TestOutput.rss", settings))
            {
                var formatter = new MediaRssFeedFormatter(myFeed);
                formatter.WriteTo(writer);
            }
        }