Hi,
Thanks wsathip, but I didn't really extract anything useful from those links. One had a solution but it involed using VBScript instead of JScript and that's not really an option for me.
Am I not making a simple mistake? such as not declaring something or something equally as silly as that? Although that wouldn't explain why it worked once and then not the second time.
EDIT: im also now getting problems with this line
XDocument.DOM.selectSingleNode("/my:myFields/my:CustomFields/my:CurrentUser").text=username;
it says its null or not an object! ???