Resolve URLs against correct document when copying.

Also provide the target document to the converter when converting
so nodes can relativise URLs against the correct base.

Bug: 58136

Change-Id: I86fe6c2f41e5498d4faf690fb10c0516cfbef247