Probably doomed attempt to do the work in XSLT