Generating linked documents when libraries are used

There are some problems in generating linked documents when libraries are used.
We needs to have hyperlinks between elements in projects and libraries.
The following moments prevents now from generating when libraries are used

  1. Links in element’s descriptions cannot be added to model elements from Libraries (the main problem for us now!)
  2. M2Doc bookmarkref does work only for current document
  3. XHTML docgen does not generate htmls for elements from libraries and does not create links to this elements (customization is needed)
    Fortunately M2Doc {m:link } could be used to generate links to other documents’bookmarks.
    {m:link ‘documentname.docx#bookmark_id’}
    I’ve created M2Doc service that determines target document name and adds link to the document
    This service is used in the following way
    {m:namedelement.extDocLink(‘Link str’)}
    Unfortunately there are some problems with links when they are used from template constructs.