A quite simpler solution.
Firstly notice that
$$
\frac{1+2\cos x+x\sin x}{1+2x\sin x+x^2}=\Re\left[\frac{1+2e^{ix}}{1-ixe^{ix}}\right]
$$
Set $\displaystyle f(z)=\dfrac{1+2e^z}{1-ze^z}$ and integrate along the righter large semicircle, i.e. the imaginary axis and the arc with radius $R\to\infty$ and $\theta\in(-\pi/2,\pi/2)$.
The former integral reduces to the desired one. The imaginary part of $f(ix)$ is odd and vanishes as we are integrating on a even region.
$$
\int_lf(z)dz=\lim_{R\to\infty}\int_{-R}^R f(ix)i~dx=i\int_{-\infty}^\infty\frac{1+2\cos x+x\sin x}{1+2x\sin x+x^2}dx
$$
Meanwhile, the latter is simple
$$
\int_{C}f(z)dz=\lim_{|z|\to\infty}\int_C\dfrac{1+2e^z}{1-ze^z}dz=-2\lim_{|z|\to\infty}\int_C\frac{dz}z=-2\int_{\pi/2}^{-\pi/2}id\theta=2\pi i
$$
The sum of the two integrals equals to $-2\pi i$ times the sum of residues in the contour since the contour is clockwise. The poles of the integrand are the solutions to $ze^z=1$, namely $W_n(1)~~ n\in \mathbb Z$ where $n$ denotes the different branches.
It is well known that when $x>0$, among $W_n(x)$ s there is only one with positive real part, which is precisely $W_0$ and is real. One can verify the statement by just referring to the graph of the function, or after some rigorous yet elementary calculations.
After all, the only pole locates at $z=\Omega$ with order $1$, and the residue is easy
$$
\text{Res}[f(z),z=\Omega]=\frac{1+2e^z}{(1-ze^z)'}\Big|_{z=\Omega}=-\frac{1+2e^\Omega}{(1+\Omega)e^\Omega}=-1-\frac1{1+\Omega}
$$
Apply the residue theorem
$$
i\int_{-\infty}^\infty\frac{1+2\cos x+x\sin x}{1+2x\sin x+x^2}dx+2\pi i=-2\pi i\left(-1-\frac1{1+\Omega}\right)
$$
Finally, note that the integrand is even and the result follows
$$
\int_0^\infty\frac{1+2\cos x+x\sin x}{1+2x\sin x+x^2}dx=\frac{\pi}{1+\Omega}
$$
where $\Omega$ is the unique real solution to $xe^x=1$.