in reply to Parsing XML...by hand (ugh)

I think a big while loop with three regexp will get you most of the way there.
while (1) { /\G<([^>]+)>/gc and do { start_tag($1); next; } /\G</([^>]+)>/gc and do { end_tag($1); next; } /\G([^<]*)/gc and do { body($1); next; } last; }
May need an /s modifier on those regexp.