code: public I_CmsExtractionResult extractContent(CmsObject cms, CmsResource resource, I_CmsSearchIndex index)
      throws CmsException {
  
          logContentExtraction(resource, index);
          try {
              CmsFile file = readFile(cms, resource);
              A_CmsXmlDocument xmlContent = CmsXmlContentFactory.unmarshal(cms, file);
              I_CmsXmlContentHandler handler = xmlContent.getHandler();
              Locale locale = index.getLocaleForResource(cms, resource, xmlContent.getLocales());
              List<String> elements = xmlContent.getNames(locale);
              StringBuffer content = new StringBuffer();
              LinkedHashMap<String, String> items = new LinkedHashMap<String, String>();
              for (Iterator<String> i = elements.iterator(); i.hasNext();) {
                  String xpath = i.next();
                  // xpath will have the form "Text[1]" or "Nested[1]/Text[1]"
                  I_CmsXmlContentValue value = xmlContent.getValue(xpath, locale);
                  if (handler.isSearchable(value)) {
                      // the content value is searchable
                      String extracted = value.getPlainText(cms);
                      if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(extracted)) {
                          items.put(xpath, 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>CmsResourceTypeXmlContent</code>.<p>
  
  All XML nodes from the content for all locales will be stored separately in the item map
  which you can access using {@link CmsExtractionResult#getContentItems()}. The XML elements will be
  accessible using their xpath. The xpath will have the form like for example
  <code>Text[1]</code> or <code>Nested[1]/Text[1]</code>.<p>
  
  @see org.opencms.search.documents.I_CmsSearchExtractor#extractContent(CmsObject, CmsResource, I_CmsSearchIndex)