Support for custom grouping of XPath expressions.

This allows the use of expressions such as "(A or B) and C".

This fixes #59.