Those examples don’t have primary keys defined in the xml because they extend the xPDOSimpleObject. The purpose of that object is a convenience for users who design with primary key fields named ’id’. xPDOSimpleObject just extends xPDOObject and adds that pk field (via it’s map file).
You can forget about xPDOSimpleObject and extend xPDOObject instead, then you can define your primary keys right in the xml, making them whatever you want, even compound keys.
Have you tried Opengeek’s "PersonPhone" example from way back in xPDO 1.0? It gives you a fairly simple many to many relationship through 3 objects - maybe not as straightforward as you’re looking for though.
http://api.modxcms.com/xpdo/tutorial_xpdo.howto.pkg.html
I’m not sure how you’d want to capture the SQL statements, but you could modify the following, run it, and look at your mysql query log:
// assuming you have instantiated $xpdo as an instance of xPDO..
$manager= $xpdo->getManager();
$generator= $manager->getGenerator();
$generator->parseSchema(PATH_TO_XML_FILE, PATH_TO_OBJECT_MODEL);
$manager-createObjectContainer('Person');
$manager-createObjectContainer('PersonPhone');
$manager-createObjectContainer('Phone');