protected void setAttribute(XmlElement xml, string name, double val) { if (!double.IsNaN(val)) xml.SetAttribute(name, val.ToString()); }