Export and look at what you get in the XML. It's worth pointing out that not everything works - the biggy is the classpaths. There's no way to set these until this bug is fixed.
thanks jj! document.currentPublishProfile is actually what I was after. I'd searched through the help without finding it, but now thanks to you I've spotted it.