private void ValidateAttribute(XElement element, XAttribute attribute, string name, string typename) { if (attribute == null || string.IsNullOrEmpty(attribute.Value)) { throw MetadataParserException.MissingAttribute(element.ToString(), name, typename); } }