Added safeguard for PerformXPathQuery()

Making sure that app won't crash if nil is passed for query parameter.