Posting your question and also sending a PM to someone has the same problem as double posting: you started two discussions that are unconnected, which wastes peoples time. The answer to your question is in this thread, which you found for yourself:
http://communities.ptc.com/message/173796#173796
As I just said in a PM: "As Werner pointed out, what is saved in the XML is not necessarily what appears in the worksheet next time it's loaded. You are looking at an evaluation, not an assignment. The results of the evaluation are saved in the XML so that (in theory) at some time in the distant future when Mathcad no longer exists the results of the calculation are still available in human readable form. However, when you open the Mathcad worksheet, since there is no assignment, there is nothing to evaluate. The only way to do what you want is to modify the XML of an assignment region.".
I just noted that in your sheet you do actually have an assignment ret:=in0. So there is something to evaluate, but since the default value for in0 is 0, that's what you get. You don't need that step, you could just use SetValue to set the value of ret directly, If you do that then when you open the sheet standalone ret will be flagged as an undefined variable. You can take your pick of those two, but what you cannot do is get ret to be 5 by using SetValue.