private static T[] GetArray <T>(ConfigElement element, T[] _, Func <ConfigElement, T, T> convert) { List <T> list = new List <T>(); foreach (var node in element.GetElements()) { list.Add(convert(node, default(T))); } return(list.Count > 0 ? list.ToArray() : null); }