Convert string to HTML/XML entities