escape XML entities to fix xmlParseEntityRef issue

fixes issue i found in #3