This is a bit of a hack, because the static lookup data this encoding requires brings template haskell to it's knees. So I've got a program that generates a haskell module file from the XML mapping.
darcs-hash:20070823034759-a4fee-883359c8951d4376fc2d783cd7be352d6c5b2111