By default, Xcode 4.1 is required for Mac OS X 10.7. However it is still possible to use Xcode 3.2.6, which is the last version of the Xcode 3 series. Just install it from the command line.

After mounting the Xcode 3.2.6 disk image in Finder, open Terminal and enter the commands

export COMMAND_LINE_INSTALL=1
open "/Volumes/Xcode and iOS SDK/Xcode and iOS SDK.mpkg"

This will open the Installer, letting you install Xcode 3.2.6 install as usual. Note: If you prefer having installed both Xcode 3.2 and 4.1 on the boot volume, make sure to install either Xcode 3.2.6 or Xcode 4.1 into a folder other than /Developer.