Step 1: Commutation condition.
Given that \( XB = BX \), we write explicitly:
\[
\begin{pmatrix}
X_{11} & X_{12} \\
X_{21} & X_{22}
\end{pmatrix}
\begin{pmatrix}
A & 0 \\
0 & C
\end{pmatrix}
=
\begin{pmatrix}
A & 0 \\
0 & C
\end{pmatrix}
\begin{pmatrix}
X_{11} & X_{12} \\
X_{21} & X_{22}
\end{pmatrix}.
\]
Step 2: Expand both sides.
Left-hand side:
\[
\begin{pmatrix}
X_{11}A & X_{12}C \\
X_{21}A & X_{22}C
\end{pmatrix},
\qquad
\text{Right-hand side: }
\begin{pmatrix}
AX_{11} & AX_{12} \\
CX_{21} & CX_{22}
\end{pmatrix}.
\]
Equating corresponding blocks gives:
\[
X_{11}A = AX_{11}, \quad
X_{22}C = CX_{22}, \quad
X_{12}C = AX_{12}, \quad
X_{21}A = CX_{21}.
\]
Step 3: Analyze the off-diagonal blocks.
Since \(A\) is invertible and \(C\) is nilpotent, consider \( X_{12}C = AX_{12} \).
Multiply on the right by \( C^k = 0 \) (for some \( k \)):
\[
X_{12}C^k = A^k X_{12} = 0 \quad \Rightarrow \quad X_{12} = 0.
\]
Similarly, \( X_{21}A = CX_{21} \) implies:
\[
C^k X_{21} = 0 = A^k X_{21} \quad \Rightarrow \quad X_{21} = 0.
\]
Step 4: Conclusion.
Thus, \( X_{12} \) and \( X_{21} \) are zero matrices, while \( X_{11} \) and \( X_{22} \) commute with \( A \) and \( C \), respectively.
Therefore, (B) is correct.