Why there is no single appendElement call
The Document service in Apps Script does not expose a generic `appendElement` method on `Body`. Every element type has its own typed append method: `appendParagraph`, `appendTable`, `appendListItem`, and so on. That means a merge loop that ignores element types will throw `TypeError: el.copy is not a function` the moment it hits a table, because you would be passing an `Element` where the API expects a `Table`.
The fix is to call `getType()` on each child element and switch on `DocumentApp.ElementType`. The type enum values are strings like `PARAGRAPH`, `TABLE`, `LIST_ITEM`, `INLINE_IMAGE`, and `HORIZONTAL_RULE`. In practice the first three account for almost all real document content. The code above handles those three and silently skips anything else (images, rules) rather than crashing the entire merge.