code: private void writeEntitySets(XMLStreamWriter writer) throws XMLStreamException, ODataRenderException {
          List<EntitySet> entitySets = getEntityContainer().getEntitySets();
          LOG.debug("Number of entity sets to be written in service document are {}", entitySets.size());
          for (EntitySet entitySet : entitySets) {
              if (entitySet.isIncludedInServiceDocument()) {
                  writeElement(writer, null, SERVICE_COLLECTION, null, entitySet.getName(), entitySet.getName());
              }
          }
      }
docs: This writes all entity sets in entity data model as collection of elements.
  
  @param writer which writes to stream.
  @throws XMLStreamException   in case of any xml errors
  @throws ODataRenderException if entity container is null.