We have some basic instructions at the URL below for using P6Spy with Spring.
P6DataSource implements the XADataSource interface.
Using XML, your datasource definition might look similar to the example below. You a are probably not using JndiObjectFactoryBean to create the DataSource but the same idea applies to whatever you are using to create the DataSource. Just wrap it with P6DataSource.
<bean id="dataSource" class="com.p6spy.engine.spy.P6DataSource">
<constructor-arg>
<bean id="DataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="jdbc/myDS"/>
</bean>
</constructor-arg>
</bean>
If this does not work for you, please let me know and I will try to help you get it working.