using XPath to replace the onClick action..

using XPath to replace the onClick action..

I have been using XPath until there , only for getting info in the DOM, 

Now, I'd like to modify the onClick action parameter  ( '123' in this case...)
"replaceAttachments('123')"   by another one   '567'  ( var id = '567' in this case) to get :
"replaceAttachments('567')" 

here is the element line :
<li><a onClick="replaceAttachments('123')" id="tab3" style="visibility:visible;" >Attachments</a></li>

how should I do ?

thanks for your help..