The type mismatch is because you're trying to send an Element object as parameter to Debug.Trace, and the scripting engine doesn't know how to convert that object to a string.
(It would work if the object had a toString() method defined, but it doesn't.)
To read the content of an Element, you use the text property. In your case, that would be as simple as:
js code:
Debug.Trace(ControlCaption.text);
And here's a nice reference of the XML DOM
at DevGuru or
at MSDN. So next time you're puzzled on something, go have a look there. They're both very complete and comprehensive, both for the newbie scripter as the experienced developer.