public static bool? ToBool(XAttribute attribute) { if (attribute == null) { return null; } return bool.Parse(attribute.Value); }