Change gui xml info with script

Basically what im trying to do is to pull in trakt ratings on the fly and update myvideonav.xml with the new rating along side imdb. I currently have it overriding imdb ratings in the database but would prefer to pull it on the fly and update the gui.

Thanks,