getNthChild method

XmlElement? getNthChild(
  1. int index,
  2. String elementName
)

Returns the nth direct child named elementName.

index must not be null and must be >= 0.

Returns null if no element can be found.

Implementation

XmlElement? getNthChild(int index, String elementName) {
  assert(index >= 0);
  assert(elementName.isNotEmpty);
  return getChildren(elementName, start: index, stop: index)?.first;
}