So, just so I'm clear - in my last entry, I demonstrated using lCase on a variable before passing it to isSimpleValue. This "fixed" the issue with the string containing XML. However, this code will throw an error if the variable contains an array or any other non-simple value. That defeats the whole purpose of using isSimpleValue.
You could wrap the call in a try/catch code block, but that turns a simple check into a multi-line workaround.
Another note - I noticed that when you pass the value to a function where the argument type is "string", it works just fine.