Updated BuildUri for XML and JSON query strings.