The only X-cart 5 documentation I know of is here:
http://kb.x-cart.com/display/XDD/Developer+docs
The Flexy template engine, is not very well documented in my opinion, not the fault of the developers really, its just that there are not many discussions about it. Its documented here:
http://pear.php.net/manual/en/package.html.html-template-flexy.php
But there are no comments or notes, its like everyone that uses it just knows how to automatically...