Added escaping of XML entities.