Protecting quantum correlations of the XXZ model by topological boundary conditions