refactor text extractor and ignore xml declarations

_process_markup was previously used to remove tags and comments. Not needed inside text: much simple to use region text_content, which already removes tags, comments and now, xml declarations.