dispose method

void dispose()

Must call this method when the Document is no longer needed.

Implementation

void dispose() {
  final nodes = NodeIterator(document: this, startNode: root).toList();
  for (final node in nodes) {
    node.dispose();
  }
}