Ended up scrapping the previous 12 hours of work and rewriting the whole thing in C#.
Fuck XSLT and its non-varying variables.

Bed now.

%d bloggers like this: