code: private void writeElement(XMLStreamWriter writer, String prefix, String elementName,
                                String nameSpaceURI, String hrefType, String title) throws XMLStreamException {
          if (isNullOrEmpty(prefix)) {
              writer.writeStartElement(elementName);
          } else {
              writer.writeStartElement(prefix, elementName, nameSpaceURI);
          }
          writer.writeAttribute(SERVICE_HREF, hrefType);
          writeTitle(writer, title);
          writer.writeEndElement();
      }
docs: This method writes to stream in following way with given parameters.
  <p/>
  <pre>
  &lt;app:elementName href="hrefType"&gt;
  &lt;atom:title type="text"&gt;title&lt;/atom:title&gt;
  &lt;/app:elementName&gt;
  </pre>
  
  @param writer       to which writing happens. Should not be null.
  @param prefix       is prefix of element if it is not null. Otherwise no prefix will be written out
  @param elementName  name of the element. Should not be null.
  @param nameSpaceURI name space of element
  @param hrefType     type of the entity set or singleton
  @param title        name of the entity set or singleton
  @throws XMLStreamException