public static XElement ElementBy(this XContainer container, AttributeName attributeName) { Contract.Requires(container.IsNotNull()); Contract.Requires(attributeName.IsNotNull()); var element = container.ElementsBy(attributeName).FirstOrDefault(); return(element); }