Merge Query and NodeSet classes