There are SP (SQL Stored Procedures) in the form of compiled DLL (and other Dlls as well) that brings the Alert functionality. However look into
\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\1033\XML\
directory for XML template files that these dlls use to format the message text.