The XA version supports the 2-phase-commit protocol for multi-resource transaction handling. Multiple resources (e.g. JMS-Provider and your database) can be enlisted to the same transaction. A commit failure on one resource will rollback the whole transaction for ALL enlisted resources (all or nothing).
Usage of the XA-datasource connection provides the maximum flexibility and reliability without introducing overhead for single-resource-only transactions (where no 2-phase commit is required)