It use to be when you queried Confluence via SOAP APIs (for instance, with getServerInfo) you got an accurate representation of the version you were attached to. Not any more:
Download: Confluence version: 5.4.1, build: 4727
OnDemand: Confluence version: 5.4.0, build: 4913