void writeService( XMLStreamWriter writer )
throws XMLStreamException {
writer.writeStartElement( WMSNS, "Service" );
writeElement( writer, WMSNS, "Name", "WMS" );
List<LanguageString> titles = identification == null ? null : identification.getTitles();
String title = ( titles != null && !titles.isEmpty() ) ? titles.get( 0 ).getString() : "deegree 3 WMS";
writeElement( writer, WMSNS, "Title", title );
List<LanguageString> abstracts = identification == null ? null : identification.getAbstracts();
if ( abstracts != null && !abstracts.isEmpty() ) {
writeElement( writer, WMSNS, "Abstract", abstracts.get( 0 ).getString() );
}
writeKeywords( writer );
writer.writeStartElement( WMSNS, "OnlineResource" );
writer.writeAttribute( XLNNS, "type", "simple" );
writer.writeAttribute( XLNNS, "href", getServiceUrl() );
writer.writeEndElement();
writeServiceProvider( writer );
final DeegreeWMS config = controller.getConfig();
maybeWriteElementNS( writer, WMSNS, "LayerLimit", config.getLayerLimit() );
maybeWriteElementNS( writer, WMSNS, "MaxWidth", config.getMaxWidth() );
maybeWriteElementNS( writer, WMSNS, "MaxHeight", config.getMaxHeight() );
writer.writeEndElement();
}