code: public String getExcerpt(String id, int maxFragments, int maxFragmentSize) throws IOException
     {
        StringBuilder text = new StringBuilder();
        try
        {
           ItemData node = ism.getItemData(id);
           String separator = "";
           List<PropertyData> childs = ism.getChildPropertiesData((NodeData)node);
           for (PropertyData property : childs)
           {
              if (property.getType() == PropertyType.STRING)
              {
                 text.append(separator);
                 separator = " ... ";
                 List<ValueData> values = property.getValues();
                 for (int i = 0; i < values.size(); i++)
                 {
                    text.append(ValueDataUtil.getString(values.get(i)));
                 }
              }
           }
  
        }
        catch (RepositoryException e)
        {
           // ignore
           LOG.warn(e.getLocalizedMessage());
        }
        if (text.length() > maxFragmentSize)
        {
           int lastSpace = text.lastIndexOf(" ", maxFragmentSize);
           if (lastSpace != -1)
           {
              text.setLength(lastSpace);
           }
           else
           {
              text.setLength(maxFragmentSize);
           }
           text.append(" ...");
        }
        return "<excerpt><fragment>" + text.toString() + "</fragment></excerpt>";
     }
docs: {@inheritDoc}