public XElement ToXml() { var props = ItemProperties.Where(a => !a.UseDefaultValue); return(new XElement("Item", new XElement("Name", this.ItemName), new XElement("Id", this.ItemID), new XElement("DefaultName", this.DefaultName), new XElement("Description", this.Description.ToXML()), new XElement("ItemClass", this.ItemClassParent.Name), new XElement("Removable", this.Removable), new XElement("Properties", from a in this.ItemProperties select a.ToXml()), new XElement("OnUse", this.OnUse.ToXML()), new XElement("Icon", this.Icon), new XElement("IsEquipment", this.IsEquipment), EquipmentRef.ToXML())); }