listFromXml<T> function
The <Xxxs> element of a model holds one child element per item.
Implementation
List<T>? listFromXml<T>(
XmlElement? xml,
String itemName,
T Function(XmlElement? xml) parse,
) {
if (xml == null) return null;
final items = <T>[];
for (final child in xml.findElements(itemName)) {
items.add(parse(child));
}
return items;
}