docs: protected String cleanForPublican(final BuildData buildData, final SpecTopic specTopic, final String translationString) {
          if (translationString == null) return null;
  
          try {
              final Document doc = TopicUtilities.convertXMLStringToDocument("<temp>" + translationString + "</temp>",
                      buildData.getDocBookVersion().getId());
  
              // Resolve the injections
              final List<Integer> types = Arrays.asList(DocBookXMLPreProcessor.XREF_INJECTION_POINT);
              final DocBookXMLPreProcessor preProcessor = buildData.getXMLPreProcessor();
              preProcessor.processInjections(buildData.getContentSpec(), specTopic, new ArrayList<String>(), doc,
                      buildData.getBuildOptions(), buildData.getBuildDatabase(), buildData.isUseFixedUrls(), types);
  
              // Remove any comments
              final List<org.w3c.dom.Node> comments = XMLUtilities.getComments(doc.getDocumentElement());
              for (final org.w3c.dom.Node comment : comments) {
                  // When removing comments we need to trim the next string as well
                  if (comment.getNextSibling() != null && comment.getNextSibling().getNodeType() == org.w3c.dom.Node.TEXT_NODE) {
                      final org.w3c.dom.Node nextNode = comment.getNextSibling();
                      nextNode.setNodeValue(StringUtilities.ltrim(nextNode.getNodeValue()));
                  }
                  // We also need to trim the previous string if the comment is the last node
                  if (comment.getNextSibling() == null && comment.getPreviousSibling() != null
                          && comment.getPreviousSibling().getNodeType() == org.w3c.dom.Node.TEXT_NODE) {
                      final org.w3c.dom.Node prevNode = comment.getPreviousSibling();
                      prevNode.setNodeValue(StringUtilities.rtrim(prevNode.getNodeValue()));
                  }
  
                  // Remove the comment from the DOM
                  comment.getParentNode().removeChild(comment);
              }
  
              // Fix up &apos; and &quot; see Translate.pm line 234-240 in publican
              fixUpEntitiesForPublican(doc, doc.getDocumentElement());
  
              return XMLUtilities.convertNodeToString(doc.getDocumentElement(), false);
          } catch (Exception e) {
              return translationString;
          }
      }