Marcelo Jimenez wrote an Arduino library to apply XSVF patterns on a JTAG interface using the Arduino as a JTAG adapter. It is especially useful for FPGA/CPLD programming. In the example provided in the GitHub repository, the XSVF file is passed through the serial port using a client-side python script.
Some time ago I started some similar work to use Arduino as a JTAG adapter, a project that I called JTAGduino. My goal was a little different: have a JTAG adapter that allows me to debug microcontrollers such as ARM Cortex-M based ones, using client-side software like OpenOCD and GDB. The project is now stalled and I didn’t proceed further, the code is on Github.