<image id="hoge" xlink:href="hoge.jpg" ... />
document.getElementById("hoge").setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', "piyo.jpg");