xmlreader: moved XML entity conversion code from html2markdown.