add some logic in ReliableXpathGenerator(not finished).