# New features in XPath 3.0

These features are available in Saxon only if explicitly enabled, either directly, or by requesting support for XSLT 3.0 or XQuery 3.0. In both cases, this requires Saxon-PE or above.

Some of the new features in XPath 3.0 are as follows. For full details, see the W3C specifications.

1. Local variables can be declared in a `let` expression, for example `let $x := /*/@version return //e[@version = $x]`

2. Inline function items can be declared, and used as arguments to higher-order functions. For example `map(//employee, function($e){$e/salary + $e/bonus})`. A function item is a third kind of item, alongside nodes and atomic values. The function represented by a function item `$f` can be invoked using a dynamic function call `$f(args)`.

3. Expanded QNames can be written in the notation `"uri":local`, allowing XPath expressions to be written that do not depend on an externally-supplied namespace context.

A number of new functions are available, including `head`, `tail`, `map`, `filter`, `map-pairs`, `pi`, `sin`, `cos`, `tan`, `asin`, `acos`, `atan`, `sqrt`, `format-integer`, and others. For details see XSLT 2.0 and XPath 2.0 Functions.