Example 6 For any subset $A$ of $X_{n}=\{1,2, \cdots, n\}$, denote the sum of all elements in $A$ as $S(A), S(\varnothing)=0$, and the number of elements in $A$ as $|A|$. Find $\sum_{A \subseteq X_{n}} \frac{S(A)}{|A|}$.
Explanation: First classify $|A|$:
Let $|A|=k(k=1,2, \cdots, n)$, then
$$
\begin{array}{l}
\sum_{A \leq X_{n}} \frac{S(A)}{|A|}=\sum_{k=1}^{n} \sum_{|A|=k} \frac{S(A)}{|A|} \\
=\sum_{k=1}^{n} \frac{1}{k} \sum_{|A|=k} S(A) .
\end{array}
$$

Next, for each element $i$ in $X_{n}$, consider the number of times $i$ appears in the sum $\sum_{|A|=k} S(A)$. If $i \in A$, noting that $|A|=k$, then the other $k-1$ elements in $A$ can be chosen in $\mathrm{C}_{n-1}^{k-1}$ ways. Therefore, the contribution of $i$ to the sum is $i \mathrm{C}_{n-1}^{k-1}$. Thus,
$$
\begin{array}{l}
\sum_{A \leq X_{n}} \frac{S(A)}{|A|}=\sum_{k=1}^{n} \frac{1}{k} \sum_{|A|=k} S(A) \\
=\sum_{k=1}^{n} \frac{1}{k} \sum_{i=1}^{n} i \mathrm{C}_{n-1}^{k-1}=\sum_{k=1}^{n} \frac{1}{k} \mathrm{C}_{n-1}^{k-1} \sum_{i=1}^{n} i \\
=\sum_{k=1}^{n} \frac{1}{k} \mathrm{C}_{n-1}^{k-1} \cdot \frac{n(n+1)}{2} \\
=\frac{n(n+1)}{2} \sum_{k=1}^{n} \frac{1}{k} \mathrm{C}_{n-1}^{k-1} \\
=\frac{n(n+1)}{2} \sum_{k=1}^{n} \frac{1}{n} \mathrm{C}_{n}^{k}=\frac{n+1}{2} \sum_{k=1}^{n} \mathrm{C}_{n}^{k} \\
=\frac{1}{2}(n+1)\left(2^{n}-1\right) .
\end{array}
$$