public static object LoadInitializer(XmlElement element)
{
string typeName = element.GetAttribute("type");
if (null == typeName || 0 == typeName.Length)
{
throw new ApplicationException(string.Format("Expected type attribute for element {0}!", element.LocalName));
}
Type type = Type.GetType(typeName);
if (null == type)
{
throw new ApplicationException(string.Format("Type \"{0}\" not found!", typeName));
}
return InitializerHelper.LoadInitializer(type, element);
}