Escape xml using helper function