use document.createElement instead of document.createElementNS if possible, to avoid casing weirdness (#549)