code: public static String inlineHtmlPage(final String html, final String basePath) {
          String retValue = html;
  
          Document doc = null;
          try {
              doc = XMLUtilities.convertStringToDocument(html);
          } catch (Exception ex) {
              LOG.error("Failed to convert the HTML into a DOM Document", ex);
          }
          if (doc != null) {
              inlineImgNodes(doc, basePath);
              inlineCssNodes(doc, basePath);
              inlineSvgNodes(doc, basePath);
  
              retValue = XMLUtilities.convertDocumentToString(doc);
          }
  
          return retValue;
      }
docs: Takes a XHTML file (usually generated by Publican), and inlines all the
  CSS, image and SVG data. The resulting string is a stand alone HTML file
  with no references to external resources.
  
  @param html     The original XHTML code
  @param basePath The path on which all the resources referenced by the
  XHTML file can be found
  @return A single, stand alone version of the XHTML