It might help if you rearrange the block diagram a little, namely the first is represented with
which after some shifting around it is equivalent to
It can also be solved by introducing some temporary variables, usually defined after summation nodes and then solve a system of linear equations. This would allow you to simultaneously solve for $C(s)$ as a function of $R(s)$ and $D(s)$.
The problem is, that you really have two different outputs for $G$. The image is a bit misleading in this regard, because it suggests that both $X$ and $Y$ are outputs of the same $G$.
For state feedback, its often useful to also look at the state space form of a system. For example, $G(s)$ in state space form is
$$
\begin{align}
\dot{x} &= A x + B u \\
y &= C x + D u
\end{align}
$$
Now, instead of this define a state space model that outputs all states:
$$
\begin{align}
\dot{x} &= A x + B u \\
y &= x
\end{align}
$$
This system has the transfer function $G_x(s) = (s I_n - A)^{-1}B$. Note: $I_n$ is a $n \times n$ identity matrix. The output $Y(s)$ is then
$$
Y(s) = C G_x(s) U(s) + D U(s)
$$
and so the original transfer function is
$$
G(s) = Y(s)/U(s) = C G_x(s) + D. \tag{1}
$$
So you can now rewrite your formula as a function of $G_x$ by using $(1)$ for $G(s)$ and $X(s) = G_x(s) U(s)$.
Best Answer
Doing away with the pesky s for the time being;