function spaghetti(workspace, depth) {
  let xml = spaghettiXml;
  for (let i = 0; i < depth; i++) {
    xml = xml.replace(
      /(<(statement|next)( name="DO0")?>)<\//g,
      '$1' + spaghettiXml + '</',
    );
  }
  xml =
    '<xml xmlns="https://developers.google.com/blockly/xml">' + xml + '</xml>';
  const dom = Blockly.utils.xml.textToDom(xml);
  console.time('Spaghetti domToWorkspace');
  Blockly.Xml.domToWorkspace(dom, workspace);
  console.timeEnd('Spaghetti domToWorkspace');
}
Populate the workspace with nested if-statement blocks, for testing.
@param {Blockly.Workspace} workspace The workspace to populate.
@param {number} depth How many layers of nesting to create.