playing around with the 'localized' markup

this markup should translate from a much simplified user query string
to the actual XPath expression.
what can be assumed? and what not? need more thinking on this