_escapeString(value, isAttribute) {
        if (_.isNil(value)) return value;
        value = value.toString()
            .replace(/&/g, "&amp;") // Escape '&' first as the other escapes add them.
            .replace(/</g, "&lt;")
            .replace(/>/g, "&gt;");

        if (isAttribute) {
            value = value.replace(/"/g, "&quot;");
        }

        return value;
    }
Escape a string for use in XML by replacing &, ", ', <, and >.
@param {*} value - The value to escape.
@param {boolean} [isAttribute] - A flag indicating if this is an attribute.
@returns {string} The escaped string.
@private