There is no way to do this with the compiler. You'd need to do some kind of string replacement in a build script.
What if the AIR application descriptor was the only place where you defined the version number? Like in your first example:
<versionNumber>3.0.0</versionNumber>
Then, if you need to display the version inside your app, you could access the XML file and check the versionNumber field. I'm pretty sure that this will work:
var descriptor:XML = NativeApplication.nativeApplication.applicationDescriptor;
var ns:Namespace = descriptor.namespace();
var versionNumber:String = descriptor.ns::versionNumber;