Improved Document::createElement().