public override XElement ToXElement() { XElement xml = base.NewXElement("Link"); if (Href.HasValue()) { xml.Add(NewXElement("href", Href)); } if (RefreshMode != KmlLinkRefreshMode.OnChange) { xml.Add(NewXElement("refreshMode", RefreshMode.ToCamelCase())); } if (RefreshMode == KmlLinkRefreshMode.OnInterval) { xml.Add(NewXElement("refreshInterval", RefreshInterval.TotalSeconds)); } return(xml); }