joshing cleanup and returning empty string when escaping XML for null or undefined