Use outerHTMl instead of writing the parent element.