Is there a way to programmatically access the application instance id?
When an app is accepted into the marketplace, it gets has two unique ids. The first is the application id, which gets inserted into WMAppManifest.xml under Deployment > App > ProductId. This id is assigned the first time your app is accepted, and does not change.
The second is the application instance id, which uniquely identifies the particular version of the app you have deployed. You get a new application instance id every time you update your app. This is how the phone knows which version of the app you are running.
My goal is to uniquely identify a particular version of an app without having to do anything manually (ex. this could easily be done by combining the ProductId and the Version from the same xml tag; but that only works if you increment the version.)
The application instance id is not exposed in the platform. However, because you must always increment the version of your app when submitting it to the marketplace, the { AppId, Version } tuple (both values can be read in WMAppManifest.xml) uniquely identifies the app instance.