src/XMLBuilder.js
/**
 * Default constructor.
 *
 * @constructor
 * @classdesc
 *
 * Simplistic implementation of a builder for XML strings. The values for all tags, attributes, attribute values and content
 * have reserved characters replaced with their corresponding XML entity, regardless if such replacement is explicitly
 * necessary (with the exception of calls to {@link XMLBuilder#appendDirect} in which the given value is appended to the
 * underlying data as-is).
 *
 * By default, the underlying data is maintained using string concatenation, however if the execution environment
 * handles `Array`-based concatenation more efficiently, set {@link XMLBuilder.useArray} to `true`.
 *
 * This implementation is state-based, and therefore, not thread-safe.
 */
Default constructor.

@constructor
@classdesc

Simplistic implementation of a builder for XML strings. The values for all tags, attributes, attribute values and content
have reserved characters replaced with their corresponding XML entity, regardless if such replacement is explicitly
necessary (with the exception of calls to  XMLBuilder#appendDirect in which the given value is appended to the
underlying data as-is).

By default, the underlying data is maintained using string concatenation, however if the execution environment
handles `Array`-based concatenation more efficiently, set  XMLBuilder.useArray to `true`.

This implementation is state-based, and therefore, not thread-safe.
Default constructor . @constructor @classdesc Simplistic implementation of a builder for XML strings . The values for all tags attributes attribute values and content have reserved characters replaced with their corresponding XML entity regardless if such replacement is explicitly necessary ( with the exception of calls to XMLBuilder#appendDirect in which the given value is appended to the underlying data as - is ) . By default the underlying data is maintained using string concatenation however if the execution environment handles ` Array ` - based concatenation more efficiently set XMLBuilder . useArray to ` true ` . This implementation is state - based and therefore not thread - safe .
function XMLBuilder() {
    'use strict';
    this.stack = [];
    this.state = XMLBuilder.STATE_INITIAL;
    this.text = XMLBuilder.useArray ? [] : ''
}
function XMLBuilder ( ) { 'use strict' ; this . stack = [ ] ; this . state = XMLBuilder . STATE_INITIAL ; this . text = XMLBuilder . useArray ? [ ] : '' }
Default constructor.
Default constructor .
/**
     * Tag name stack.
     *
     * @private
     * @type {Array}
     */ /**
     * Current state of this `XMLBuilder`. Corresponds to one of the `STATE_*` static members of this class.
     *
     * @private
     * @type {number}
     */ /**
     * The raw text of this `XMLBuilder`. If {@link XMLBuilder.useArray} is `true`, it will be an `Array`, otherwise a `string`.
     *
     * @private
     * @type {(string|Array)}
     */