toXml() {
        // Create a node.
        const node = {
            name: 'c',
            attributes: this._remainingAttributes || {}, // Start with any remaining attributes we don't current handle.
            children: []
        };

        // Set the address.
        node.attributes.r = this.address();

        if (!_.isNil(this._formulaType)) {
            // Add the formula.
            const fNode = {
                name: 'f',
                attributes: this._remainingFormulaAttributes || {}
            };

            if (this._formulaType !== "normal") fNode.attributes.t = this._formulaType;
            if (!_.isNil(this._formulaRef)) fNode.attributes.ref = this._formulaRef;
            if (!_.isNil(this._sharedFormulaId)) fNode.attributes.si = this._sharedFormulaId;
            if (!_.isNil(this._formula)) fNode.children = [this._formula];

            node.children.push(fNode);
        } else if (!_.isNil(this._value)) {
            // Add the value. Don't emit value if a formula is set as Excel will show this stale value.
            let type, text;
            if (typeof this._value === "string") {
                type = "s";
                text = this.workbook().sharedStrings().getIndexForString(this._value);
            } else if (typeof this._value === "boolean") {
                type = "b";
                text = this._value ? 1 : 0;
            } else if (typeof this._value === "number") {
                text = this._value;
            } else if (this._value instanceof Date) {
                text = dateConverter.dateToNumber(this._value);
            } else if (this._value instanceof RichText || typeof this._value === "object" && this._value.constructor.name === "RichText") { // Hack to make Jasmine test work
                type = "s";
                text = this.workbook().sharedStrings().getIndexForString(this._value.toXml());
            }

            if (type) node.attributes.t = type;
            const vNode = { name: 'v', children: [text] };
            node.children.push(vNode);
        }

        // If the style is set, set the style ID.
        if (!_.isNil(this._style)) {
            node.attributes.s = this._style.id();
        } else if (!_.isNil(this._styleId)) {
            node.attributes.s = this._styleId;
        }

        // Add any remaining children that we don't currently handle.
        if (this._remainingChildren) {
            node.children = node.children.concat(this._remainingChildren);
        }

        return node;
    }
Convert the cell to an XML object.
@returns {{}} The XML form.
@ignore