Doctor, doctor
The LazyWeb came through in fine style indeed; I had three offers of help and one “don’t use XSLT! use this!” message.
Turns out my stylesheet wasn’t the cow; 4XSLT was. The cure, as the doctor said to the patient, is “don’t do that.”
So I’m grabbing Python bindings to Saxon and Xalan and whathaveyou, and I’ll take care of business that way.