private static string GetAttribute(XElement element, params string[] attributes) { foreach (string name in attributes) { string value = (from a in element.Attributes() where a.Name.LocalName == name select a.Value) .FirstOrDefault(); if (name != null) { return value; } } return ""; }