private void appendEntitySets(final XMLStreamWriter writer, final List<EdmEntitySet> entitySets)
      throws XMLStreamException {
    for (EdmEntitySet entitySet : entitySets) {
      writer.writeStartElement(XML_ENTITY_SET);
      writer.writeAttribute(XML_NAME, entitySet.getName());
      writer.writeAttribute(
          XML_ENTITY_TYPE, getAliasedFullQualifiedName(entitySet.getEntityType(), false));
      if (!entitySet.isIncludeInServiceDocument()) {
        writer.writeAttribute(
            XML_INCLUDE_IN_SERVICE_DOCUMENT, "" + entitySet.isIncludeInServiceDocument());
      }

      appendNavigationPropertyBindings(writer, entitySet);
      writer.writeEndElement();
    }
  }
 private void writeEntitySets(final JsonGenerator gen, final EdmEntityContainer container)
     throws IOException {
   for (EdmEntitySet edmEntitySet : container.getEntitySets()) {
     if (edmEntitySet.isIncludeInServiceDocument()) {
       writeElement(gen, null, edmEntitySet.getName(), edmEntitySet.getName());
     }
   }
 }