For real numbers $x, y$ and $z$ it is known that $x + y = 2$ and $xy = z^2 + 1$.
Find the value of the expression $x^2 + y^2+ z^2$.
1. Given the equations:
   \[
   x + y = 2
   \]
   \[
   xy = z^2 + 1
   \]

2. Consider the quadratic equation \( t^2 - (x+y)t + xy = 0 \) with roots \( x \) and \( y \). By Vieta's formulas, we know:
   \[
   x + y = 2 \quad \text{(sum of the roots)}
   \]
   \[
   xy = z^2 + 1 \quad \text{(product of the roots)}
   \]

3. Substitute \( x + y = 2 \) and \( xy = z^2 + 1 \) into the quadratic equation:
   \[
   t^2 - 2t + (z^2 + 1) = 0
   \]

4. Solve the quadratic equation using the quadratic formula \( t = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} \):
   \[
   t = \frac{2 \pm \sqrt{4 - 4(z^2 + 1)}}{2}
   \]
   \[
   t = \frac{2 \pm \sqrt{4 - 4z^2 - 4}}{2}
   \]
   \[
   t = \frac{2 \pm \sqrt{-4z^2}}{2}
   \]
   \[
   t = \frac{2 \pm 2i|z|}{2}
   \]
   \[
   t = 1 \pm i|z|
   \]

5. For \( x \) and \( y \) to be real numbers, the imaginary part must be zero. Therefore:
   \[
   i|z| = 0 \implies |z| = 0 \implies z = 0
   \]

6. With \( z = 0 \), the quadratic equation simplifies to:
   \[
   t^2 - 2t + 1 = 0
   \]
   \[
   (t - 1)^2 = 0
   \]
   \[
   t = 1
   \]

7. Thus, \( x = 1 \) and \( y = 1 \).

8. Finally, calculate \( x^2 + y^2 + z^2 \):
   \[
   x^2 + y^2 + z^2 = 1^2 + 1^2 + 0^2 = 1 + 1 + 0 = 2
   \]

The final answer is \(\boxed{2}\)