private void appendCustomProperties(
     final XMLStreamWriter writer, final EntityInfoAggregator eia, final Map<String, Object> data)
     throws EntityProviderException {
   List<String> noneSyndicationTargetPaths = eia.getNoneSyndicationTargetPathNames();
   for (String tpName : noneSyndicationTargetPaths) {
     EntityPropertyInfo info = eia.getTargetPathInfo(tpName);
     final String name = info.getName();
     XmlPropertyEntityProducer aps = new XmlPropertyEntityProducer();
     aps.appendCustomProperty(writer, name, info, data.get(name));
   }
 }
  private void appendProperties(
      final XMLStreamWriter writer, final EntityInfoAggregator eia, final Map<String, Object> data)
      throws EntityProviderException {
    try {
      List<String> propertyNames = eia.getSelectedPropertyNames();
      if (!propertyNames.isEmpty()) {
        writer.writeStartElement(Edm.NAMESPACE_M_2007_08, FormatXml.M_PROPERTIES);

        for (String propertyName : propertyNames) {
          EntityPropertyInfo propertyInfo = eia.getPropertyInfo(propertyName);

          if (isNotMappedViaCustomMapping(propertyInfo)) {
            Object value = data.get(propertyName);
            XmlPropertyEntityProducer aps = new XmlPropertyEntityProducer();
            aps.append(writer, propertyInfo.getName(), propertyInfo, value);
          }
        }

        writer.writeEndElement();
      }
    } catch (XMLStreamException e) {
      throw new EntityProviderException(EntityProviderException.COMMON, e);
    }
  }