Finite State Models for XML Processing