"G1 = A gateway that translates between XMPP and the protocol(s) used on a foreign (non-XMPP) messaging network"
I don't think my question was not vague at all. It just might be out of the ordinary. Most people are interested in XMPP client implementations. I want a pre-existing open-source project that would be a good first step towards building an XMPP gateway.
So, I can help you out. The only library that I know of that is designed specifically for the purpose of implementing gateways is Thrasher Bird: http://developer.berlios.de/projects/thrasher/ (git at http://repo.or.cz/w/thrasher.git ). I am the lead developer of that library. While the "sales pitch" is that it wraps libpurple, it is actually designed so that the "gateway" part of the library is separate from the "protocol" part of the library, unlike every other gateway I've seen.
It's in Perl, and it's still a bit alpha-ish, but it is also exactly what you are looking for and in active development, so you'll have to decide whether that meets your needs.
If you're interested in more information or need help, contact me at jbowers@barracuda.com . Compiling may be a bit of a chore, but I've managed it on a couple of different Linux systems now.