Use `importNode` to avoid `NullPointerException`s.

`adoptNode` fails if the two documents use different XML implementations
and returns `null` in this case. `importNode` should always be safe.