makes xPath return a JSON parsable string