In this article, I have explained, how you can create XML document in C# using Console application, it should work in ASP.NET Web-Forms or MVC, as C# code remains same.
In this article, I have explained about in memory cache in C# with an console application example in .NET and .NET Core, how to add cache item, remove it, update it or get it's value.