How to serialize a class to an xml structure?

flooldfaminna

New Member
How could I serialize my below class {0} to the below xml {1}.So, the class name, property names should match to the xml.{0}:\[code\][Serializable]public class ProfileSite{ [XmlAttribute("profileId")] public int ProfileId { get; set; } [XmlAttribute("siteId")] public int SiteId { get; set; } public Link[] Links { get; set; } public XElement Deserialize() { }}\[/code\]{1}:\[code\]<profileSite profileId="" siteId=""> <links> <link> <originalUrl></originalUrl> <isCrawled></isCrawled> <isBroken></isBroken> <isHtmlPage></isHtmlPage> <firstAppearedLevel></firstAppearedLevel> </link> </links> </profileSite>\[/code\]Many thanks,
 
Back
Top