Please solve the programming task below using a self-contained code snippet in a markdown code block.

A square matrix is said to be an X-Matrix if both of the following conditions hold:

All the elements in the diagonals of the matrix are non-zero.
All other elements are 0.

Given a 2D integer array grid of size n x n representing a square matrix, return true if grid is an X-Matrix. Otherwise, return false.
 
Please complete the following python code precisely:
```python
class Solution:
    def checkXMatrix(self, grid: List[List[int]]) -> bool:
```