MODE-1680 The xpath query is not well-formed

Fix for parsing error, extension to support function fn:name, child axis in order by clause