code: private void insertAfter(final URI hrefValue, final StringBuffer parentResult, final CharSequence tmpContent) {
          int insertpoint = parentResult.lastIndexOf("</");
          final int end = parentResult.indexOf(">", insertpoint);
  
          if (insertpoint == -1 || end == -1) {
              logger.error(MessageUtils.getMessage("DOTJ033E", hrefValue.toString()).toString());
          } else {
              if (ELEMENT_NAME_DITA.equals(parentResult.substring(insertpoint, end).trim())) {
                  insertpoint = parentResult.lastIndexOf("</", insertpoint - 1);
              }
              parentResult.insert(insertpoint, tmpContent);
          }
      }
docs: Append XML content into root element
  
  @param hrefValue    href of the topicref
  @param parentResult XML content to insert into
  @param tmpContent   XML content to insert