As described in http://invisible-island.net/xterm/ctlseqs/ctlseqs.html, xterm supports escape sequences to read or change the X clipboard. This has been implemented in HTerm, a JavaScript-based terminal emulator: https://github.com/chromium/hterm/blob/master/etc/osc52.el
Would it make sense to integrate this into xterm.el directly?