An extensive Python library for dealing with FoLiA (Format for Linguistic Annotation) documents, a rich XML-based format for linguistic annotation finding application in Natural Language Processing (NLP). This library was formerly part of PyNLPl.
@ErkanBasar: This is now implemented as the Document.erase() method (docs) as well as a separate new command line tool foliaerase as part of FoLiA tools.
In addition to undeclare(), we need something that actively checks whether certain declarations are redundant and cleans it up.