Hi
tls!
This is an interesting task and I will be glad to help you with it. As a first step, create your own module according to the guide here:
http://kb.x-cart.com/display/XDD/Step+1+-+creating+simplest+module
Then, I will explain what to do next.