Apple has begun selling Xcode 4 through the Mac App Store for $4.99. Previously Xcode could be downloaded for free if you were a basic member of the Apple Developer Connection, but with Xcode 4 you either need to purchase it or become a full member of ADC.

Several people have experienced data loss after attempting to install Xcode 4 purchased and downloaded through the Mac App Store. Although this is not effected everyone, there’s a growing thread on the Apple Discussion Forums indicating in some cases mounted volumes (including the boot volume) get mysteriously wiped clean during the Xcode install.

If you decide to purchase Xcode 4, I would recommend making sure you have a full backup of your boot drive just in case, and that you unmount all external volumes before installing.