Added Java version of XA example.