SMACK-541 MXParser.getText reliance fix

I've extracted this code from my codebase I'm currently using in prod for handling XHTML on both desktop and Android and it works pretty well so far.