Encode text for XML