title: In OpenLayers 6.9.0 I use fetch WMTSCapabilities but I it doesn't work
body: <p>I use fetch WMTSCapabilities but I get this message: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'Layer')
  at Function.rL.source.WMTS.optionsFromCapabilities (ol.js:2)</p>
  <p>This is the code I use:</p>
  <pre><code>const parser = new ol.format.WMTSCapabilities();
  let bgRaster;
  fetch('data/WMTSCapabilities.xml')
    .then(function (response) {
      return response.text();
    })
    .then(function (text) {
      const result = parser.read(text);
      const options = ol.source.WMTS.optionsFromCapabilities(result, {
        layer: 'standaard',
        format: 'image/png',
        matrixSet: 'EPSG:28992',
      });
      bgRaster = new ol.layer.Tile({
            opacity: 0.7,
            source: new ol.source.WMTS(options),
            title: 'Kadaster',
            visible: false
          });
    })
  </code></pre>