Use a more stable method for XML escaping