static validate(root) {
    const flatTree = [];

    flattenTree(root, null, [], flatTree);
    const propertiesToSkip = ["id", "children", "name", "toname", "controlledTags", "parentTypes"];
    const validationResult = [];

    for (const child of flatTree) {
      try {
        const model = Registry.getModelByTag(child.type);
        // Validate name attribute
        const nameValidation = validateNameTag(child, model);

        if (nameValidation !== null) validationResult.push(nameValidation);

        // Validate toName attribute
        const toNameValidation = validateToNameTag(child, model, flatTree);

        if (toNameValidation !== null) validationResult.push(toNameValidation);

        // Validate by parentUnexpected parent tag
        const parentValidation = validateParentTag(child, model);

        if (parentValidation !== null) validationResult.push(parentValidation);

        validationResult.push(...validatePerRegion(child));

        validationResult.push(...validateAttributes(child, model, propertiesToSkip));
      } catch (e) {
        validationResult.push(errorBuilder.unknownTag(child.type, child.name, child.type));
      }
    }

    if (validationResult.length) {
      return validationResult.map((error) => ({
        ...error,
        validType: humanizeTypeName(error.validType),
      }));
    }

    return [];
  }
Validate node attributes and compatibility with other nodes
@param {*} node