The latest version of XBattleAI is XBattleAI v1.2.2, you can find the full source code for it here . There have been many new things introduced in the latest version and many old things, such as the Gauntled Campaign, are now broken. You may therefor be interested also in the last release, XBattleAI v1.2.1 if you want those features. (You can also try XbattleAI v1.2.0 if you want).
TODO: Some extra compilation instructions