private string GetNamespacePrefix(XAttribute attribute) { var attr = attribute.ToString(); var match = Regex.Match(attr, @"^(?'NamespacePrefix'\w+):"); return match.Success ? match.Groups["NamespacePrefix"].Value : string.Empty; }