Tunnel A-X
In current A<->X config, most likely you're allowing LanA<->LanX. At side A , add tunnel under peer for LanA<->LanB traffic. Do the same at site X.
Tunnel B-X
Repeat similar steps like above
This solution doesn't scale well. Use IPSEC VTI tunnel interfaces instead, and add a routing protocol to the mix....to make it all happen automatically