Fixed XPathQuery to behave properly when multiple elements are selected

Signed-off-by: gburgett <gordon.burgett@gmail.com>