FELIX-594: Pretty print generated xml.

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@662751 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/scrplugin/src/main/java/org/apache/felix/scrplugin/xml/ComponentDescriptorIO.java b/scrplugin/src/main/java/org/apache/felix/scrplugin/xml/ComponentDescriptorIO.java
index cc15f8d..916e618 100644
--- a/scrplugin/src/main/java/org/apache/felix/scrplugin/xml/ComponentDescriptorIO.java
+++ b/scrplugin/src/main/java/org/apache/felix/scrplugin/xml/ComponentDescriptorIO.java
@@ -197,14 +197,15 @@
         IOUtils.addAttribute(ai, "servicefactory", String.valueOf(service.isServicefactory()));
         IOUtils.indent(contentHandler, 2);
         contentHandler.startElement(NAMESPACE_URI, ComponentDescriptorIO.SERVICE, ComponentDescriptorIO.SERVICE_QNAME, ai);
-        if ( service.getInterfaces() != null ) {
+        if ( service.getInterfaces() != null && service.getInterfaces().size() > 0 ) {
+            IOUtils.newline(contentHandler);
             final Iterator i = service.getInterfaces().iterator();
             while ( i.hasNext() ) {
                 final Interface interf = (Interface)i.next();
                 generateXML(interf, contentHandler);
             }
+            IOUtils.indent(contentHandler, 2);
         }
-        IOUtils.indent(contentHandler, 2);
         contentHandler.endElement(NAMESPACE_URI, ComponentDescriptorIO.SERVICE, ComponentDescriptorIO.SERVICE_QNAME);
         IOUtils.newline(contentHandler);
     }