An SCXML interpreter in XQuery