Check out the plug/socket interface in GTK2. It is the normal way to do this, AFAIK. I have not tried xterm but other programs have embedded just fine.
Comment on Re: xterm keyboard focus problem when embeded
The sample gtk2 script I gave does use the socket interface. I've tried embedding a few other programs, like mplayer, and dillo, and they work with mouse only in their window.....but no keyboard.