public static @Nullable XmlToken getTokenOfType(PsiElement element, @NotNull IElementType type) {
    if (element == null) {
      return null;
    }

    PsiElement[] children = element.getChildren();

    for (PsiElement child : children) {
      if (child instanceof XmlToken token) {

        if (token.getTokenType() == type) {
          return token;
        }
      }
    }

    return null;
  }
public static @Nullable XmlToken getTokenOfType(PsiElement element, @NotNull IElementType type)