An experiment of two-stage adaptive compensation for polarization mode dispersion (PMD) iu a 40-Gb/s optical time-division multiplexed communication system is reported. The PMD monitoring technique based on degree of polarization was adopted. The particle swarm optimization (PSO) algorithm was introduced in adaptive PMD compensation. The comparison was made to estimate the effectiveness between PSO algorithms with global neighborhood structure (GPSO) and with local neighborhood structure (LPSO). The LPSO algorithm is shown to be more effective to search global optimum for PMD compensation than GPSO algorithm. The two-stage PMD compensator is shown to be effective for both first- and second-order PMD, and he compensator is shown to be bit rate independent. The optimum searching time is within one huudred milliseconds.