Implement Element.prefix (Fixes #1737)

See #1737.

r? @ms2ger