CustomXID used by test cases is missing a step (class an null test) in the equals() method.
Expose this as protected, to let other classes leverage it.
Truely make the abstracts abstract, and implement the getXAConnection which returns a standard non-interleaving data source in the concrete class.
The POLARIS FullXA Implementation. This implements XA Transaction interleaving for PostgreSQL, by multiplexing connections if necessary.
This implementation makes a nobel effort to operate within the bounds of the connection pool's existing connection size, and only allocates new physical connections if a spare (idle) connection is unavailable for a configurable amount of time (see PGFullXADataSource.xaAcquireTimeout).

Setting xaAcquireTimeout = 0, effectively disables interleaving. The default is 50ms.
In a high-traffic production environment consisting of mixed transaction duty-cycle (short requests and long-running processes) running GlassFish 3.1.2.2, we've found 500ms to be more than sufficient to keep the pools from behaving erratically. The higher the timeout the less erratic the pool size vs. physical connection size will be, at the expense of transaction 'pauses' while the driver waits for connection contention to calm down.