I moved from Java to C# and I am automating webservices in C#. There is a piece of code which is calling below method for converting the XML document to String
XmlDocument document = new XmlDocument();
document.Load(filePath + fileName);
var xml = document.ToXml();
public static string ToXml<T>(this T toSerialize) where T : class
Can someone explain me what exactly the above method is doing, i understand the return type is String but what is this piece of code meant ToXml<T>(this T toSerialize) where T : class
Can someone also explain me what is meant by "generic"?