Prefer *Derived helper functions (is_*element) than string comparison

Seems cleaner and faster than comparing local_name strings.