private void writeAttribution(final XMLStreamWriter writer, final Attribution attribution)
     throws XMLStreamException {
   if (attribution != null) {
     writer.writeStartElement("Attribution");
     if (attribution.getTitle() != null) {
       writer.writeStartElement("Title");
       writer.writeCharacters(attribution.getTitle());
       writer.writeEndElement();
     }
     writeOnlineResource(writer, attribution.getUrl());
     if (attribution.getLogoUrl() != null) {
       final LogoUrl logoUrl = attribution.getLogoUrl();
       writer.writeStartElement("LogoURL");
       if (logoUrl.getWidth() != null) {
         writer.writeAttribute("width", "" + logoUrl.getWidth());
       }
       if (logoUrl.getHeight() != null) {
         writer.writeAttribute("height", "" + logoUrl.getHeight());
       }
       if (logoUrl.getFormat() != null) {
         writer.writeStartElement("Format");
         writer.writeCharacters(logoUrl.getFormat());
         writer.writeEndElement();
       }
       writeOnlineResource(writer, logoUrl.getUrl());
       writer.writeEndElement();
     }
     writer.writeEndElement();
   }
 }