Added simple XPath inspired state lookup.