static cloneNode(node) {
    if (!node) {
      return null;
    }
    /** @type {!shaka.extern.xml.Node} */
    const clone = {
      tagName: node.tagName,
      attributes: shaka.util.ObjectUtils.shallowCloneObject(node.attributes),
      children: [],
      parent: null,
    };
    for (const child of node.children) {
      if (typeof child === 'string') {
        clone.children.push(child);
      } else {
        const clonedChild = shaka.util.TXml.cloneNode(child);
        clonedChild.parent = clone;
        clone.children.push(clonedChild);
      }
    }
    return clone;
  }
Clones node and its children recursively. Skips parent.
@param {?shaka.extern.xml.Node} node
@return {?shaka.extern.xml.Node}