import module namespace dt = "http://www.zorba-xquery.com/modules/datetime"; dt:millis-to-dateTime( xs:long( 1359439013001 ) ) (: Expected output: 2013-01-29T05:56:53.001Z :)