Step 1: Squaring both equations.
We are given two equations:
\[
x \cos \theta + y \sin \theta = 5 \quad \text{(1)}
\]
\[
x \sin \theta - y \cos \theta = 3 \quad \text{(2)}
\]
Squaring both equations:
\[
(x \cos \theta + y \sin \theta)^2 = 25
\]
\[
(x \sin \theta - y \cos \theta)^2 = 9
\]
Step 2: Adding the squared equations.
Now add the two equations:
\[
(x^2 \cos^2 \theta + 2xy \cos \theta \sin \theta + y^2 \sin^2 \theta) + (x^2 \sin^2 \theta - 2xy \cos \theta \sin \theta + y^2 \cos^2 \theta) = 25 + 9
\]
Simplifying this, we get:
\[
x^2 (\cos^2 \theta + \sin^2 \theta) + y^2 (\cos^2 \theta + \sin^2 \theta) = 34
\]
Since \( \cos^2 \theta + \sin^2 \theta = 1 \), we get:
\[
x^2 + y^2 = 34
\]
Step 3: Conclusion.
Thus, \( x^2 + y^2 = 34 \), which makes option (D) the correct answer.