I thought there was a quick, scriptable command-line method of downloading xcode:
xcode-select --install