private static SimpleInstanceProvider ParseSimpleInstanceElement(XElement xSimpleInstance) { var xValue = xSimpleInstance.Value; var typeName = xSimpleInstance.Attribute("type")?.Value; if (typeName == null) { try { return(new SimpleInstanceProvider(ValueUtilities.Parse(xValue))); } catch (Exception ex) { throw new XmlException(xSimpleInstance, ex); } } var value = ValueUtilities.ParseToType(xValue, typeName); return(new SimpleInstanceProvider(value)); }