Write out document sources to the correct location.