Similar Items: Alternating register automata on finite words and trees