refactoring: move getNearest/Next/PreviousTextElement out of DocumentElment