code: public static String entryToLDIF( final ChaiEntry theEntry )
              throws ChaiUnavailableException, ChaiOperationException
      {
          final StringBuilder sb = new StringBuilder();
          sb.append( "dn: " ).append( theEntry.getEntryDN() ).append( "\n" );
  
          final Map<String, Map<String, List<String>>> results = theEntry.getChaiProvider().searchMultiValues(
                  theEntry.getEntryDN(),
                  "(objectClass=*)",
                  null,
                  SearchScope.BASE
          );
          final Map<String, List<String>> props = results.get( theEntry.getEntryDN() );
  
          for ( final Map.Entry<String, List<String>> entry : props.entrySet() )
          {
              final String attrName = entry.getKey();
              final List<String> values = entry.getValue();
              for ( final String value : values )
              {
                  sb.append( attrName ).append( ": " ).append( value ).append( '\n' );
              }
          }
  
          return sb.toString();
      }
docs: Convert to an LDIF format.  Useful for debugging or other purposes
  
  @param theEntry A valid {@code ChaiEntry}
  @return A string containing a properly formatted LDIF view of the entry.
  @throws ChaiOperationException   If there is an error during the operation
  @throws ChaiUnavailableException If the directory server(s) are unavailable