updated for XPath 3.0 functions

added support for curly braces - but still need to check the nesting of
these - to highlight issues