var profileXml =
new XElement("HBProfile",
new XElement("Name", profile.Name),
new XElement("MinLevel", profile.MinLevel.ToString()),
new XElement("MaxLevel", profile.MaxLevel.ToString()),
new XElement("MinDurability", profile.MinDurability.ToString()),
new XElement("MinFreeBagSlots", profile.MinFreeBagSlots.ToString()),
new XElement("MailGrey", profile.MailGrey.ToString()),
new XElement("MailWhite", profile.MailWhite.ToString()),
new XElement("MailGreen", profile.MailGreen.ToString()),
new XElement("MailBlue", profile.MailBlue.ToString()),
new XElement("MailPurple", profile.MailPurple.ToString()),
new XElement("SellGrey", profile.SellGrey.ToString()),
new XElement("SellWhite", profile.SellWhite.ToString()),
new XElement("SellGreen", profile.SellGreen.ToString()),
new XElement("SellBlue", profile.SellBlue.ToString()),
new XElement("SellPurple", profile.SellPurple.ToString()),
new XElement("TargetElites", profile.TargetElites.ToString()),
new XElement("ContinentId", profile.ContinentId.ToString()));
profileXml.Save("someProfile.xml");