Proper XML and URL encoding