code: public I_CmsExtractionResult extractContent(CmsObject cms, CmsResource resource, I_CmsSearchIndex index)
      throws CmsException {
  
          logContentExtraction(resource, index);
          try {
              CmsFile file = readFile(cms, resource);
              CmsXmlPage page = CmsXmlPageFactory.unmarshal(cms, file);
              Locale locale = index.getLocaleForResource(cms, resource, page.getLocales());
  
              List<String> elements = page.getNames(locale);
              StringBuffer content = new StringBuffer();
              LinkedHashMap<String, String> items = new LinkedHashMap<String, String>();
              for (Iterator<String> i = elements.iterator(); i.hasNext();) {
                  String elementName = i.next();
                  String value = page.getStringValue(cms, elementName, locale);
                  String extracted = CmsHtmlExtractor.extractText(value, page.getEncoding());
                  if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(extracted)) {
                      items.put(elementName, extracted);
                      content.append(extracted);
                      content.append('\n');
                  }
              }
  
              return new CmsExtractionResult(content.toString(), items);
  
          } catch (Exception e) {
              throw new CmsIndexException(
                  Messages.get().container(Messages.ERR_TEXT_EXTRACTION_1, resource.getRootPath()),
                  e);
          }
      }
docs: Returns the raw text content of a given vfs resource of type <code>CmsResourceTypeXmlPage</code>.<p>
  
  @see org.opencms.search.documents.I_CmsSearchExtractor#extractContent(CmsObject, CmsResource, I_CmsSearchIndex)