I'm unable to reproduce the error you're getting with that code - which is incomplete (lacks return and else clauses, doesn't define $key). But paring those issues away, your code runs fine for me, as follows:
let $value := '"2001-10-18T08:47:00"'
xs:dateTime(replace($value, '"', ''))
Asked in February 2016Viewed 1,587 timesVoted 10Answered 1 times