Inserting them as textContent into a dummy element and then extracting them again?