  In 1999, Xing, Niederreiter and Lam introduced a generalization of AG codes
using the evaluation at non-rational places of a function field. In this paper,
we show that one can obtain a locality parameter $r$ in such codes by using
only non-rational places of degrees at most $r$. This is, up to the author's
knowledge, a new way to construct locally recoverable codes (LRCs). We give an
example of such a code reaching the Singleton-like bound for LRCs, and show the
parameters obtained for some longer codes over $\mathbb F_3$. We then
investigate similarities with certain concatenated codes. Contrary to previous
methods, our construction allows one to obtain directly codes whose dimension
is not a multiple of the locality. Finally, we give an asymptotic study using
the Garcia-Stichtenoth tower of function fields, for both our construction and
a construction of concatenated codes. We give explicit infinite families of
LRCs with locality 2 over any finite field of cardinality greater than 3
following our new approach.
