https://libcst.readthedocs.io/en/latest/tutorial.html#Build-...
It is a little less pure than the functional XSLT, and also a lot more practical.