lot of optimization work, results in significant improvements when handling really complex XPath queries. Add a small optimizer for unions, improve [n] and [last()], avoid some costly ops. Daniel