findElementOrNull function

XmlElement? findElementOrNull(
  1. XmlElement element,
  2. String name, {
  3. String? namespace,
})

Implementation

XmlElement? findElementOrNull(XmlElement element, String name, {String? namespace}) {
  try {
    return element.findAllElements(name, namespace: namespace).first;
  } on StateError {
    return null;
  }
}