Shouldn't
code:
xmlDoc.getElementById(Messenger.MyUserId) == "null"
be
code:
xmlDoc.GetElementById(Messenger.MyUserId) == null
MSDN says jscript for GetElementById should be capitalized like that. And most things when you check for null aren't in quotes. Your checking against the string null not null itself.