Adding xml pretty printing function.
pretty print entities before submission