6. $(10!)^{2}$.

Since $x_{i}>0$, we have
$$
\begin{array}{l}
\sum_{i=1}^{20}\left(\left|x_{i}-i\right|+\left|x_{i}+i\right|\right) \\
=\sum_{i=1}^{20}\left(\left|x_{i}-i\right|+\left(x_{i}+i\right)\right) \\
=\sum_{i=1}^{20}\left|x_{i}-i\right|+\sum_{i=1}^{20}\left(x_{i}+i\right) \\
=\sum_{i=1}^{20}\left|x_{i}-i\right|+\sum_{i=1}^{20} 2 i=620 .
\end{array}
$$

The original expression simplifies to $\sum_{i=1}^{20}\left|x_{i}-i\right|=200$.
Notice that,
$$
|a-b|=\max \{a, b\}-\min \{a, b\},
$$

and $\left(x_{1}, x_{2}, \cdots, x_{20}\right)$ is a permutation of $(1,2, \cdots, 20)$.
Thus, in
$$
\max \left\{x_{i}, i\right\} 、 \min \left\{x_{i}, i\right\}(i=1,2, \cdots, 20)
$$

each number can be the maximum or minimum at most twice.
$$
\begin{array}{l}
\text { Then } \sum_{i=1}^{20} \max \left\{x_{i}, i\right\}-\sum_{i=1}^{20} \min \left\{x_{i}, i\right\} \\
\leqslant 2 \sum_{i=11}^{20} i-2 \sum_{i=1}^{10} i .
\end{array}
$$

Therefore, $200=\sum_{i=1}^{20}\left|x_{i}-i\right|$
$$
\begin{array}{l}
=\sum_{i=1}^{20}\left(\max \left\{x_{i}, i\right\}-\min \left\{x_{i}, i\right\}\right) \\
=\sum_{i=1}^{20} \max \left\{x_{i}, i\right\}-\sum_{i=1}^{20} \min \left\{x_{i}, i\right\} \\
\leqslant 2 \sum_{i=11}^{20} i-2 \sum_{i=1}^{10} i=200 .
\end{array}
$$

Thus, $\left\{x_{1}, x_{2}, \cdots, x_{10}\right\}=\{11,12, \cdots, 20\}$,
$$
\left\{x_{11}, x_{12}, \cdots, x_{20}\right\}=\{1,2, \cdots, 10\} \text {. }
$$

By the principle of counting distributions, the number of permutations $\left(x_{1}, x_{2}, \cdots, x_{20}\right)$ is $(10!)^{2}$.
6. Let $\left(x_{1}, x_{2}, \cdots, x_{20}\right)$ be a permutation of $(1,2, \cdots, 20)$, and satisfy
$$
\sum_{i=1}^{20}\left(\left|x_{i}-i\right|+\left|x_{i}+i\right|\right)=620 \text {. }
$$

Then the number of such permutations is. $\qquad$