An experiment of two-stage adaptive compensation for polarization mode dispersion (PMD) in a 40 Gb/s optical time-division multiplexed (OTDM) communication system is reported. The PMD monitoring technique based on degree of polarization (DOP) 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 ability of tracking changed PMD using PSO algorithm was also investigated. The two-stage PMD compensator is shown to be effective for both first- and second-order PMD, and the compensator is shown to be bit rate independent. The optimum searching time is within several hundreds of milliseconds. The response time for recovery from a sharp disturbance is about 11 ms.