Another option should one wish to preserve other formatting such as paragraphs & headings is to use innertext rather than plaintext then perform your own string cleaning with the result.
I realise there is a performance hit but it does allow for more granular control.