Step 1: Identify matrices.
Given:
\[
X = \begin{bmatrix} 1 & 0 0 & 1 \end{bmatrix}, \quad
Y = \begin{bmatrix} 0 & 1 -1 & 0 \end{bmatrix}
\]
Step 2: Multiply \( X \cos \theta \).
\[
X \cos \theta =
\cos \theta \begin{bmatrix} 1 & 0 0 & 1 \end{bmatrix}
=
\begin{bmatrix} \cos \theta & 0 0 & \cos \theta \end{bmatrix}
\]
Step 3: Multiply \( Y \sin \theta \).
\[
Y \sin \theta =
\sin \theta \begin{bmatrix} 0 & 1 -1 & 0 \end{bmatrix}
=
\begin{bmatrix} 0 & \sin \theta -\sin \theta & 0 \end{bmatrix}
\]
Step 4: Add both matrices.
\[
X \cos \theta + Y \sin \theta
=
\begin{bmatrix} \cos \theta & 0 0 & \cos \theta \end{bmatrix}
+
\begin{bmatrix} 0 & \sin \theta -\sin \theta & 0 \end{bmatrix}
\]
\[
=
\begin{bmatrix} \cos \theta & \sin \theta -\sin \theta & \cos \theta \end{bmatrix}
\]
Step 5: Compare with given matrix \( B \).
\[
B = \begin{bmatrix} \cos \theta & \sin \theta -\sin \theta & \cos \theta \end{bmatrix}
\]
Clearly, both matrices are identical.
Step 6: Final conclusion.
\[
\boxed{B = X \cos \theta + Y \sin \theta}
\]