code: public static synchronized void setServiceEnabled(XMPPConnection connection, boolean enabled) {
          if (isServiceEnabled(connection) == enabled)
              return;
  
          if (enabled) {
              ServiceDiscoveryManager.getInstanceFor(connection).addFeature(XHTMLExtension.NAMESPACE);
          }
          else {
              ServiceDiscoveryManager.getInstanceFor(connection).removeFeature(XHTMLExtension.NAMESPACE);
          }
      }
docs: Enables or disables the XHTML support on a given connection.<p>
  
  Before starting to send XHTML messages to a user, check that the user can handle XHTML
  messages. Enable the XHTML support to indicate that this client handles XHTML messages.
  
  @param connection the connection where the service will be enabled or disabled
  @param enabled indicates if the service will be enabled or disabled