XA is the general specification for distributed transactions(DT). This is not tied to any technology or language.
JTA is the implementation (actually specification) developed to support DTs in Java. A DT can involve more than one "database" or one database + another resource (say JMS).
A normal JDBC driver cannot participate in a DT, whereas an XA JDBC driver can. So, for a same database, depending on the driver this can change.
In a JEE app, you can configure normal DataSource or XADataSource for the source to participate in a DT. For programmatic JTA, servlets can do a jndi lookup for UserTransaction and use it.
EJBs support declarative transaction support via annotations.
I don't know much about Spring and Hibernate. But you can have JPA EntityManager participate in DT.