How to achieve fractional polynomials in stan

Hi, I’m wondering if fractional polynomials could be achieved in stan.
Following the definition of Patrick Royston et al. (1994), for example, a fractional polynomial of degree 2 can be illustrated as

\phi_2(x;\xi,p)=\xi_0+\xi_1 x^{(p_1)}+\xi_2 x^{(p_2)},

where x>0, \xi=(\xi_0,\xi_1,\xi_2) is coefficient, p=(p_1,p_2) is the vector of power. These p_j come from a set S={-2,-1,-0.5,0,0.5,1,2,3}. If p_j=0, then x^{(p_j)}=lnx; If p_1=p_2, then x^{p_2}=x^{p_1}lnx.
Maybe doing variable selection by backward elimination is one option, but I don’t know how to achieve it. Any advice would be appreciated.