static handleXlinkInElement_(
      element, retryParameters, failGracefully, baseUri, networkingEngine,
      linkDepth) {
    const MpdUtils = shaka.dash.MpdUtils;
    const TXml = shaka.util.TXml;
    const Error = shaka.util.Error;
    const ManifestParserUtils = shaka.util.ManifestParserUtils;
    const NS = MpdUtils.XlinkNamespaceUri_;

    const xlinkHref = TXml.getAttributeNS(element, NS, 'href');
    const xlinkActuate =
        TXml.getAttributeNS(element, NS, 'actuate') || 'onRequest';

    // Remove the xlink properties, so it won't download again
    // when re-processed.
    for (const key of Object.keys(element.attributes)) {
      const segments = key.split(':');
      const namespace = shaka.util.TXml.getKnownNameSpace(NS);
      if (segments[0] == namespace) {
        delete element.attributes[key];
      }
    }

    if (linkDepth >= 5) {
      return shaka.util.AbortableOperation.failed(new Error(
          Error.Severity.CRITICAL, Error.Category.MANIFEST,
          Error.Code.DASH_XLINK_DEPTH_LIMIT));
    }

    if (xlinkActuate != 'onLoad') {
      // Only xlink:actuate="onLoad" is supported.
      // When no value is specified, the assumed value is "onRequest".
      return shaka.util.AbortableOperation.failed(new Error(
          Error.Severity.CRITICAL, Error.Category.MANIFEST,
          Error.Code.DASH_UNSUPPORTED_XLINK_ACTUATE));
    }

    // Resolve the xlink href, in case it's a relative URL.
    const uris = ManifestParserUtils.resolveUris([baseUri], [xlinkHref]);

    // Load in the linked elements.
    const requestType = shaka.net.NetworkingEngine.RequestType.MANIFEST;
    const request =
        shaka.net.NetworkingEngine.makeRequest(uris, retryParameters);

    const requestOperation = networkingEngine.request(requestType, request);
    // The interface is abstract, but we know it was implemented with the
    // more capable internal class.
    goog.asserts.assert(
        requestOperation instanceof shaka.util.AbortableOperation,
        'Unexpected implementation of IAbortableOperation!');
    // Satisfy the compiler with a cast.
    const networkOperation =
    /** @type {!shaka.util.AbortableOperation.<shaka.extern.Response>} */ (
        requestOperation);

    // Chain onto that operation.
    return networkOperation.chain(
        (response) => {
          // This only supports the case where the loaded xml has a single
          // top-level element.  If there are multiple roots, it will be
          // rejected.
          const rootElem =
              TXml.parseXml(response.data, element.tagName);
          if (!rootElem) {
            // It was not valid XML.
            return shaka.util.AbortableOperation.failed(new Error(
                Error.Severity.CRITICAL, Error.Category.MANIFEST,
                Error.Code.DASH_INVALID_XML, xlinkHref));
          }

          // Now that there is no other possibility of the process erroring,
          // the element can be changed further.

          // Remove the current contents of the node.
          element.children = [];

          // Move the children of the loaded xml into the current element.
          while (rootElem.children.length) {
            const child = rootElem.children.shift();
            element.children.push(child);
          }

          // Move the attributes of the loaded xml into the current element.
          for (const key of Object.keys(rootElem.attributes)) {
            element.attributes[key] = rootElem.attributes[key];
          }

          return shaka.dash.MpdUtils.processXlinks(
              element, retryParameters, failGracefully, uris[0],
              networkingEngine, linkDepth + 1);
        });
  }
Follow the xlink link contained in the given element.
It also strips the xlink properties off of the element,
even if the process fails.

@param {!shaka.extern.xml.Node} element
@param {!shaka.extern.RetryParameters} retryParameters
@param {boolean} failGracefully
@param {string} baseUri
@param {!shaka.net.NetworkingEngine} networkingEngine
@param {number} linkDepth
@return {!shaka.util.AbortableOperation.<!shaka.extern.xml.Node>}
@private