function serializeElement(element) {
		if (element == null) return '';
		if (typeof element !== 'object') return String(element);
		if (Array.isArray(element)) return element.map(serializeElement).join('');
		const type = element.type;
		let s = `<${type}`;
		const props = element.props || {};
		let children = element.children;
		for (const prop of Object.keys(props).sort()) {
			const value = props[prop];
			// Filter out empty values:
			if (value == null) continue;
			if (prop === 'children' || prop === 'textContent') children = value;
			else s += ` ${prop}="${enc(value)}"`;
		}
		s += '>';
		if (!/link|meta|base/.test(type)) {
			if (children) s += serializeElement(children);
			s += `</${type}>`;
		}
		return s;
	}
@param {HeadElement|HeadElement[]|Set<HeadElement>} element
@returns {string} html