code: protected String prepareContent(String content, CmsObject cms, CmsResource xmlPage, String path) {
  
          // cut off eventually existing html skeleton
          content = CmsStringUtil.extractHtmlBody(content);
  
          // add tags for stylesheet
          String stylesheet = getUriStyleSheet(cms, xmlPage);
  
          // content-type
          String encoding = CmsLocaleManager.getResourceEncoding(cms, xmlPage);
          String contentType = CmsResourceManager.MIMETYPE_HTML + "; charset=" + encoding;
  
          content = CmsEncoder.adjustHtmlEncoding(content, encoding);
  
          // rewrite uri
          Object obj = cms.getRequestContext().getAttribute(CmsObjectWrapper.ATTRIBUTE_NAME);
          if (obj != null) {
              CmsObjectWrapper wrapper = (CmsObjectWrapper)obj;
              stylesheet = wrapper.rewriteLink(stylesheet);
          }
  
          String base = OpenCms.getSystemInfo().getOpenCmsContext();
  
          StringBuffer result = new StringBuffer(content.length() + 1024);
          result.append("<html><head>");
  
          // meta: content-type
          result.append("<meta http-equiv=\"content-type\" content=\"");
          result.append(contentType);
          result.append("\">");
  
          // title as full path
          result.append("<title>");
          result.append(cms.getRequestContext().removeSiteRoot(path));
          result.append("</title>");
  
          // stylesheet
          if (!"".equals(stylesheet)) {
              result.append("<link href=\"");
              result.append(base);
              result.append(stylesheet);
              result.append("\" rel=\"stylesheet\" type=\"text/css\">");
          }
  
          result.append("</head><body>");
          result.append(content);
          result.append("</body></html>");
          content = result.toString();
  
          return content.trim();
      }
docs: Prepare the content of a xml page before returning.<p>
  
  Mainly adds the basic html structure and the css style sheet.<p>
  
  @param content the origin content of the xml page element
  @param cms the initialized CmsObject
  @param xmlPage the xml page resource
  @param path the full path to set as the title in the html head
  
  @return the prepared content with the added html structure