2. Let $f(x)$ be a function defined on the set of real numbers with a period of 2, and it is an even function. It is known that when $x \in[2,3]$, $f(x)=x$, then when $x \in[-2,0]$, the analytical expression of $f(x)$ is
A. $f(x)=x+4$
B. $f(x)=2-x$
C. $f(x)=3-|x+1|$
D. $f(x)=2+|x+1|$