private string GetAttributeValue(XElement element, string attrName) { var attr = element.Attribute(attrName); return attr != null ? attr.Value : null; }