17. (12 points) Draw a line through point $P(3+2 \sqrt{2}, 4)$ that intersects the $x$-axis and $y$-axis at points $M$ and $N$, respectively. Find the maximum value of $OM + ON - MN$ (where $O$ is the origin).
17. A circle is drawn through the point $P(3+2 \sqrt{2}, 4)$, tangent to the $x$-axis and $y$-axis at points $A$ and $B$ respectively, and such that point $P$ lies on the major arc $\overparen{A B}$. The equation of the circle is $(x-3)^{2}+(y-3)^{2}=9$. Thus, the tangent line through point $P$ intersects the $x$-axis and $y$-axis at points $M_{1}$ and $N_{1}$, respectively, making the circle the incircle of $\mathrm{Rt} \triangle O M_{1} N_{1}$. Therefore, $O M_{1}+O N_{1}-M_{1} N_{1}=6$.

If the line $M N$ through point $P$ does not touch the circle, then a tangent line parallel to $M N$ is drawn, intersecting the $x$-axis and $y$-axis at points $M_{0}$ and $N_{0}$, respectively. Thus, $O M_{0}+O N_{0}-M_{0} N_{0}=6$.

By the length of the broken line $M_{0} M N N_{0}$ being greater than the length of $M_{0} N_{0}$ and the tangent segment theorem, we have
$$
\begin{array}{l}
O M+O N-M N \\
=\left(O M_{0}-M M_{0}\right)+\left(O N_{0}-N N_{0}\right)-M N \\
=\left(O M_{0}+O N_{0}-M_{0} N_{0}\right)+\left[M_{0} N_{0}-\left(M_{0} M+M N+N N_{0}\right)\right] \\
<O M_{0}+O N_{0}-M_{0} N_{0}=6 .
\end{array}
$$

Therefore, the maximum value of $O M+O N-M N$ is 6.