public static string GetAttributeValue(this XmlElement xmlElement, string attributeName) { XmlAttribute attr = xmlElement.Attributes[attributeName]; return attr == null ? null : attr.Value; }