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|$
For $x \in[0,1]$, $x+2 \in[2,3] \Rightarrow f(x)=f(x+2)=x+2$, thus for $x \in[-1,0]$, $-x \in[0,1] \Rightarrow f(x)=f(-x)=-x+2$, for $x \in[-2,-1]$, $x+4 \in[2,3] \Rightarrow f(x)=f(x+4)=x+4$. Therefore, for $x \in[-2,0]$, $f(x)=3-|x+1|$, so the answer is $C$.