backend JSON generating with XPATH