XML Serialization - Collection to XML

When developing a business application / any application, we should try to avoid unwanted code and try to summarize as much as code as possible. Generic methods are a way of reducing the lines of code.
I always prefer using ADO .Net for all the business applications I develop; and I am always concerned about passing the values / data between Client apps (Silverlight) and Web service. To make it very less in size, I sent it as XML data, but again, Get xml from a class / collection or building a class from an xml is a bit head ache when you follow the traditional method, which uses XDocument, XElement etc… Better method is to use XmlSerializer. You can achieve this in 5 – 6 lines of code
Download source code

Comments