Serializing Lists of Classes to XML

So some times we want to convert object to xml. We can follow severel cumbersome methods. So I am using Utlity methods to convert c# object to xml and xml to c# object. Suppose we have class like below And we want serialize List<Student> to xml. So we can use this utlity function As a example we populate List<student> ¬†with dummy data Then call out utility function then out xml variable look like as below