Lego’s XL Motor has the most mechanical power of all the Lego Power Functions. At 9V, it can deliver about 0.4 of a Newton-metre (N·m), the measurement for torque. One newton-metre is the equal to the torque created by perpendicularly applying one newton of force to a one metre arm able to rotate on one endpoint. The Lego mindstorms NXT large motor has similar characteristics, as I believe they are similar constructions.
All Lego power functions have the same connector with four nodes. The two outer nodes power receivers, and the inner nodes supply power to the motor. The motor will run if it is directly connected to a power supply (no more than 9V) via the inner nodes on the connector.
If you want to take apart an XL motor, for modding or curiosity, the dark gray top must be removed. This requires grinding down the bumps that hold it on. The motor on the left is ready to be taken apart.
Then, pop off the top. Squeezing the sides and pulling will work, but a screw driver can help to remove it easily.
There is an electric motor and a planetary gear reduction system inside.
The electric motor inside is what powers the XL motor. The electric motor has caps on the bottom. They may be capacitors, noise reduction caps, or for regenerative braking. If they are capacitors, they would gain energy when the motor is forcefully stopped, and then releases it to turn the motor with more power. Noise reduction and regenrative caps would do exactly as they sound like they would.
The planetary gear reduction slows the output of the electric motor and gives the whole motor more torque. However, the gearing adds some friction. The motor would spin faster and should be a little bit more efficient without the reduction.
To mod the XL motor, removing the two bumps on the bottom of the planetary casing would allow the whole system to rotate, with a little bit less friction. Another way would be to glue the gears to the carrier and shave off the teeth on the outer side so that the carrier and gears rotate with the motor, but without touching the ring gear in the casing.
Before modding, make sure to have a plan, have the correct tools, and keep in mind that it may fail. With the XL motor, modding will only slightly improve the motor’s efficiency.
Here is some helpful information and comparisons of Lego motors.