Enter the code shown above in the box below.
If you can figure a way to store the data with the user profile (you can create your own profile definition), then any profile information is exposed to most of the email templates as input.

XSL also has the ability to retrieve data from external source via the document() and unparsed-text() function where you can pass a URL with parameters and retrieve the data back. So in theory, if you can expose a URL that can return data that you need, you can let the XSL query your data externally.