There is a beta version of Xcode for developers just as there always is. However, the Xcode in the appstore is not the current Developer Beta (for obvious reasons, it's a beta)
If you download the Appstore Xcode you will be able to write applications for iOS5 however you will not be able to use some of the new iOS features until iOS5 (and Xcode) are officially released.
Basically what i'm trying to say is, anything you write in appstore Xcode will be compatible with iOS 5 but you just can't use the new iOS5 features. I think that makes sense, i've only just woken up!