Text this: Alternating register automata on finite words and trees