public static double? GetDoubleAttributeValue(this XmlElement xmlElement, string attributeName) { XmlAttribute attr = xmlElement.Attributes[attributeName]; return attr == null ? (double?) null : Double.Parse(attr.Value, CultureInfo.InvariantCulture); }