6. Point $P$ is in the same plane as the square $A B C D$ with side length $\sqrt{2}$, and $P A^{2}+P B^{2}=P C^{2}$. Then the maximum value of $P D$ is ( ).
(A) 4
(B) $2+2 \sqrt{2}$
(C) 6
(D) $2+3 \sqrt{2}$
6. (B).

To maximize $PD$, point $P$ and side $CD$ should be on opposite sides of $AB$. Draw $PE \perp AB$ at $E$ (as shown in Figure 3). Let $PE=x$ and $AE=y$. Then
$$
\begin{array}{l}
BE=\sqrt{2}-y, \\
PA^{2}=PE^{2}+AE^{2}=x^{2}+y^{2}, \\
PB^{2}=PE^{2}+BE^{2}=x^{2}+(\sqrt{2}-y)^{2}, \\
PC^{2}=BE^{2}+(PE+BC)^{2} \\
=(\sqrt{2}-y)^{2}+(x+\sqrt{2})^{2}, \\
PD^{2}=(PE+AD)^{2}+AE^{2}=(x+\sqrt{2})^{2}+y^{2}. \\
\because PA^{2}+PB^{2}=PC^{2}, \\
\therefore x^{2}+y^{2}+x^{2}+(\sqrt{2}-y)^{2} \\
=(\sqrt{2}-y)^{2}+(x+\sqrt{2})^{2}. \\
\therefore y^{2}=2+2 \sqrt{2} x-x^{2} \geqslant 0. \\
\therefore x \leqslant 2+\sqrt{2}. \\
\therefore PD^{2}=(x+\sqrt{2})^{2}+y^{2} \\
=4+4 \sqrt{2} x \leqslant 4+4 \sqrt{2}(2+\sqrt{2}) \\
=(2+2 \sqrt{2})^{2}. \\
\end{array}
$$

Therefore, $PD \leqslant 2+2 \sqrt{2}$.
Thus, the maximum value of $PD$ is $2+2 \sqrt{2}$.