{
    XMLSave xmlSave = createXMLSave();

    if (options == null)
    {
      options = Collections.EMPTY_MAP;
    }

    ResourceHandler handler = (ResourceHandler)options.get(OPTION_RESOURCE_HANDLER);

    if (handler != null)
    {
      handler.preSave(this, outputStream, options);
    }

    xmlSave.save(this, outputStream, options);


    if (handler != null)
    {
      handler.postSave(this, outputStream, options);
    }
  }