6. In the Cartesian coordinate system, the "rectilinear distance" between points $P\left(x_{1}, y_{1}\right)$ and $Q\left(x_{2}, y_{2}\right)$ is defined as
$$
d(P, Q)=\left|x_{1}-x_{2}\right|+\left|y_{1}-y_{2}\right| \text {. }
$$

If point $C(x, y)$ has equal rectilinear distances to $A(1,3)$ and $B(6,9)$, where the real numbers $x$ and $y$ satisfy $0 \leqslant x, y \leqslant 10$, then the sum of the lengths of all loci of points $C$ that satisfy the condition is $\qquad$ .
6. $5(\sqrt{2}+1)$.

From the problem, we have
$$
|x-1|+|y-3|=|x-6|+|y-9| \text {. }
$$

When $y \geqslant 9, y \leqslant 3$, equation (1) transforms into
$$
\begin{array}{l}
|x-1|+6=|x-6|, \\
|x-1|=6+|x-6| .
\end{array}
$$

Both have no solutions.
When $3 \leqslant y \leqslant 9$, equation (1) transforms into
$$
2 y-12=|x-6|-|x-1| \text {. }
$$

If $x \leqslant 1$, then $y=8.5$, the length of the line segment is 1;
If $1 \leqslant x \leqslant 6$, then $x+y=9.5$, the length of the line segment is $5 \sqrt{2}$; if $x \geqslant 6$, then $y=3.5$, the length of the line segment is 4.
In summary, the sum of the lengths of the line segments that form the trajectory of point $C$ is
$$
1+5 \sqrt{2}+4=5(\sqrt{2}+1)
$$