public XElement ToXml() { var res = new XElement("Media"); res.SetAttributeValue("Id", Id); res.SetAttributeValue("Title", Title); res.SetAttributeValue("Type", Type); res.SetAttributeValue("PublicUrl", PublicUrl); return res; }