By default the element order of the input is preserved. The view designer is able to define a new order of elements. Once again notice that extremely powerful order manipulation mechanisms will compromise type inference and closure under composition. In this case he can specify that the order is nondeterministic thereby leaving room for optimization. The above policies deal with specifying an order for the view.
Similar considerations apply to checking the order of the input elements.
In order to apply similar optimization techniques as those developed for relational databases, an XML query language should have an equivalent algebra. It is desirable to have a language that tackles all tasks required in the mediation process. In this way we can avoid the impedance mismatch caused by using multiple languages and we create extra opportunities for optimization. It has recently been extended to allow navigational recursion in a clean way. However it is cumbersome or less powerful when it comes to conventional search and join.