use of document for embedded resources