The max function takes one argument, which is a sequence. So it must be written max((2,3)). The replace() function is not implemented in QuiP. QuiP was developed as an early prototype/demonstrator of XQuery functionality and it is not up to date with the latest specs. For a more up-to-date implementation, you might try Saxon available from http://saxon.sf.net/
Michael Kay
#webMethods#API-Management#Tamino