public static void RemoveIfExists(this XAttribute attribute) { if (attribute == null) return; attribute.Remove(); } }