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 c0d9d8d..b9a1f43 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
@@ -144,10 +144,10 @@
     protected static void generateXML(Component component, ContentHandler contentHandler)
     throws SAXException {
         final AttributesImpl ai = new AttributesImpl();
-        addAttribute(ai, "enabled", component.isEnabled());
-        addAttribute(ai, "immediate",component.isImmediate());
-        addAttribute(ai, "name", component.getName());
-        addAttribute(ai, "factory", component.getFactory());
+        IOUtils.addAttribute(ai, "enabled", component.isEnabled());
+        IOUtils.addAttribute(ai, "immediate",component.isImmediate());
+        IOUtils.addAttribute(ai, "name", component.getName());
+        IOUtils.addAttribute(ai, "factory", component.getFactory());
 
         contentHandler.startElement(NAMESPACE_URI, ComponentDescriptorIO.COMPONENT, ComponentDescriptorIO.COMPONENT_QNAME, ai);
         generateXML(component.getImplementation(), contentHandler);
@@ -180,7 +180,7 @@
     protected static void generateXML(Implementation implementation, ContentHandler contentHandler)
     throws SAXException {
         final AttributesImpl ai = new AttributesImpl();
-        addAttribute(ai, "class", implementation.getClassame());
+        IOUtils.addAttribute(ai, "class", implementation.getClassame());
         contentHandler.startElement(NAMESPACE_URI, ComponentDescriptorIO.IMPLEMENTATION, ComponentDescriptorIO.IMPLEMENTATION_QNAME, ai);
         contentHandler.endElement(NAMESPACE_URI, ComponentDescriptorIO.IMPLEMENTATION, ComponentDescriptorIO.IMPLEMENTATION_QNAME);
     }
@@ -194,7 +194,7 @@
     protected static void generateXML(Service service, ContentHandler contentHandler)
     throws SAXException {
         final AttributesImpl ai = new AttributesImpl();
-        addAttribute(ai, "servicefactory", service.getServicefactory());
+        IOUtils.addAttribute(ai, "servicefactory", service.getServicefactory());
         contentHandler.startElement(NAMESPACE_URI, ComponentDescriptorIO.SERVICE, ComponentDescriptorIO.SERVICE_QNAME, ai);
         if ( service.getInterfaces() != null ) {
             final Iterator i = service.getInterfaces().iterator();
@@ -215,7 +215,7 @@
     protected static void generateXML(Interface interf, ContentHandler contentHandler)
     throws SAXException {
         final AttributesImpl ai = new AttributesImpl();
-        addAttribute(ai, "interface", interf.getInterfacename());
+        IOUtils.addAttribute(ai, "interface", interf.getInterfacename());
         contentHandler.startElement(NAMESPACE_URI, ComponentDescriptorIO.INTERFACE, ComponentDescriptorIO.INTERFACE_QNAME, ai);
         contentHandler.endElement(NAMESPACE_URI, ComponentDescriptorIO.INTERFACE, ComponentDescriptorIO.INTERFACE_QNAME);
     }
@@ -229,15 +229,15 @@
     protected static void generateXML(Property property, ContentHandler contentHandler)
     throws SAXException {
         final AttributesImpl ai = new AttributesImpl();
-        addAttribute(ai, "name", property.getName());
-        addAttribute(ai, "type", property.getType());
-        addAttribute(ai, "value", property.getValue());
+        IOUtils.addAttribute(ai, "name", property.getName());
+        IOUtils.addAttribute(ai, "type", property.getType());
+        IOUtils.addAttribute(ai, "value", property.getValue());
         contentHandler.startElement(NAMESPACE_URI, ComponentDescriptorIO.PROPERTY, ComponentDescriptorIO.PROPERTY_QNAME, ai);
         if ( property.getMultiValue() != null && property.getMultiValue().length > 0 ) {
             for(int i=0; i<property.getMultiValue().length; i++) {
-                text(contentHandler, "    ");
-                text(contentHandler, property.getMultiValue()[i]);
-                text(contentHandler, "\n");
+                IOUtils.text(contentHandler, "    ");
+                IOUtils.text(contentHandler, property.getMultiValue()[i]);
+                IOUtils.text(contentHandler, "\n");
             }
         }
         contentHandler.endElement(NAMESPACE_URI, ComponentDescriptorIO.PROPERTY, ComponentDescriptorIO.PROPERTY_QNAME);
@@ -252,46 +252,18 @@
     protected static void generateXML(Reference reference, ContentHandler contentHandler)
     throws SAXException {
         final AttributesImpl ai = new AttributesImpl();
-        addAttribute(ai, "name", reference.getName());
-        addAttribute(ai, "interface", reference.getInterfacename());
-        addAttribute(ai, "cardinality", reference.getCardinality());
-        addAttribute(ai, "policy", reference.getPolicy());
-        addAttribute(ai, "target", reference.getTarget());
-        addAttribute(ai, "bind", reference.getBind());
-        addAttribute(ai, "unbind", reference.getUnbind());
+        IOUtils.addAttribute(ai, "name", reference.getName());
+        IOUtils.addAttribute(ai, "interface", reference.getInterfacename());
+        IOUtils.addAttribute(ai, "cardinality", reference.getCardinality());
+        IOUtils.addAttribute(ai, "policy", reference.getPolicy());
+        IOUtils.addAttribute(ai, "target", reference.getTarget());
+        IOUtils.addAttribute(ai, "bind", reference.getBind());
+        IOUtils.addAttribute(ai, "unbind", reference.getUnbind());
         contentHandler.startElement(NAMESPACE_URI, ComponentDescriptorIO.REFERENCE, ComponentDescriptorIO.REFERENCE_QNAME, ai);
         contentHandler.endElement(NAMESPACE_URI, ComponentDescriptorIO.REFERENCE, ComponentDescriptorIO.REFERENCE_QNAME);
     }
 
     /**
-     * Helper method to add an attribute.
-     * This implementation adds a new attribute with the given name
-     * and value. Before adding the value is checked for non-null.
-     * @param ai    The attributes impl receiving the additional attribute.
-     * @param name  The name of the attribute.
-     * @param value The value of the attribute.
-     */
-    protected static void addAttribute(AttributesImpl ai, String name, Object value) {
-        if ( value != null ) {
-            ai.addAttribute("", name, name, "CDATA", value.toString());
-        }
-    }
-
-    /**
-     * Helper method writing out a string.
-     * @param ch
-     * @param text
-     * @throws SAXException
-     */
-    protected static void text(ContentHandler ch, String text)
-    throws SAXException {
-        if ( text != null ) {
-            final char[] c = text.toCharArray();
-            ch.characters(c, 0, c.length);
-        }
-    }
-
-    /**
      * A content handler for parsing the component descriptions.
      *
      */
diff --git a/scrplugin/src/main/java/org/apache/felix/scrplugin/xml/IOUtils.java b/scrplugin/src/main/java/org/apache/felix/scrplugin/xml/IOUtils.java
index 40cbe5c..c199090 100644
--- a/scrplugin/src/main/java/org/apache/felix/scrplugin/xml/IOUtils.java
+++ b/scrplugin/src/main/java/org/apache/felix/scrplugin/xml/IOUtils.java
@@ -375,4 +375,31 @@
         }
     }
 
+    /**
+     * Helper method to add an attribute.
+     * This implementation adds a new attribute with the given name
+     * and value. Before adding the value is checked for non-null.
+     * @param ai    The attributes impl receiving the additional attribute.
+     * @param name  The name of the attribute.
+     * @param value The value of the attribute.
+     */
+    protected static void addAttribute(AttributesImpl ai, String name, Object value) {
+        if ( value != null ) {
+            ai.addAttribute("", name, name, "CDATA", value.toString());
+        }
+    }
+
+    /**
+     * Helper method writing out a string.
+     * @param ch
+     * @param text
+     * @throws SAXException
+     */
+    protected static void text(ContentHandler ch, String text)
+    throws SAXException {
+        if ( text != null ) {
+            final char[] c = text.toCharArray();
+            ch.characters(c, 0, c.length);
+        }
+    }
 }
diff --git a/scrplugin/src/main/java/org/apache/felix/scrplugin/xml/MetaTypeIO.java b/scrplugin/src/main/java/org/apache/felix/scrplugin/xml/MetaTypeIO.java
index bfc3058..7e84dac 100644
--- a/scrplugin/src/main/java/org/apache/felix/scrplugin/xml/MetaTypeIO.java
+++ b/scrplugin/src/main/java/org/apache/felix/scrplugin/xml/MetaTypeIO.java
@@ -63,6 +63,9 @@
     protected static final String AD_ELEMENT = "AD";
     protected static final String AD_ELEMENT_QNAME = PREFIX + ':' + AD_ELEMENT;
 
+    protected static final String OPTION_ELEMENT = "Option";
+    protected static final String OPTION_ELEMENT_QNAME = PREFIX + ':' + OPTION_ELEMENT;
+
     public static void write(MetaData metaData, File file)
     throws MojoExecutionException {
         try {
@@ -89,7 +92,7 @@
         contentHandler.startPrefixMapping(PREFIX, NAMESPACE_URI);
 
         final AttributesImpl ai = new AttributesImpl();
-        addAttribute(ai, "localization", metaData.getLocalization());
+        IOUtils.addAttribute(ai, "localization", metaData.getLocalization());
 
         contentHandler.startElement(NAMESPACE_URI, METADATA_ELEMENT, METADATA_ELEMENT_QNAME, ai);
 
@@ -111,9 +114,9 @@
     protected static void generateXML(OCD ocd, ContentHandler contentHandler)
     throws SAXException {
         final AttributesImpl ai = new AttributesImpl();
-        addAttribute(ai, "id", ocd.getId());
-        addAttribute(ai, "name", ocd.getName());
-        addAttribute(ai, "description", ocd.getDescription());
+        IOUtils.addAttribute(ai, "id", ocd.getId());
+        IOUtils.addAttribute(ai, "name", ocd.getName());
+        IOUtils.addAttribute(ai, "description", ocd.getDescription());
         contentHandler.startElement(NAMESPACE_URI, OCD_ELEMENT, OCD_ELEMENT_QNAME, ai);
 
         final Iterator i = ocd.getProperties().iterator();
@@ -128,8 +131,8 @@
     protected static void generateXML(AttributeDefinition ad, ContentHandler contentHandler)
     throws SAXException {
         final AttributesImpl ai = new AttributesImpl();
-        addAttribute(ai, "id", ad.getId());
-        addAttribute(ai, "type", ad.getType());
+        IOUtils.addAttribute(ai, "id", ad.getId());
+        IOUtils.addAttribute(ai, "type", ad.getType());
         if ( ad.getDefaultMultiValue() != null ) {
             final StringBuffer buf = new StringBuffer();
             for(int i=0; i<ad.getDefaultMultiValue().length; i++) {
@@ -138,22 +141,23 @@
                 }
                 buf.append(ad.getDefaultMultiValue()[i]);
             }
-            addAttribute(ai, "default", buf);
+            IOUtils.addAttribute(ai, "default", buf);
         } else {
-            addAttribute(ai, "default", ad.getDefaultValue());
+            IOUtils.addAttribute(ai, "default", ad.getDefaultValue());
         }
-        addAttribute(ai, "name", ad.getName());
-        addAttribute(ai, "description", ad.getDescription());
-        addAttribute(ai, "cardinality", ad.getCardinality());
+        IOUtils.addAttribute(ai, "name", ad.getName());
+        IOUtils.addAttribute(ai, "description", ad.getDescription());
+        IOUtils.addAttribute(ai, "cardinality", ad.getCardinality());
         contentHandler.startElement(NAMESPACE_URI, AD_ELEMENT, AD_ELEMENT_QNAME, ai);
 
         if (ad.getOptions() != null) {
             for (Iterator oi=ad.getOptions().entrySet().iterator(); oi.hasNext(); ) {
                 final Map.Entry entry = (Map.Entry) oi.next();
                 ai.clear();
-                addAttribute(ai, "value", String.valueOf(entry.getKey()));
-                addAttribute(ai, "label", String.valueOf(entry.getValue()));
-                contentHandler.startElement(NAMESPACE_URI, "Option", PREFIX + ':' + "Option", ai);
+                IOUtils.addAttribute(ai, "value", String.valueOf(entry.getKey()));
+                IOUtils.addAttribute(ai, "label", String.valueOf(entry.getValue()));
+                contentHandler.startElement(NAMESPACE_URI, OPTION_ELEMENT, OPTION_ELEMENT_QNAME, ai);
+                contentHandler.endElement(NAMESPACE_URI, OPTION_ELEMENT, OPTION_ELEMENT_QNAME);
             }
         }
 
@@ -163,7 +167,7 @@
     protected static void generateXML(Designate designate, ContentHandler contentHandler)
     throws SAXException {
         final AttributesImpl ai = new AttributesImpl();
-        addAttribute(ai, "pid", designate.getPid());
+        IOUtils.addAttribute(ai, "pid", designate.getPid());
         contentHandler.startElement(NAMESPACE_URI, DESIGNATE_ELEMENT, DESIGNATE_ELEMENT_QNAME, ai);
 
         generateXML(designate.getObject(), contentHandler);
@@ -174,23 +178,8 @@
     protected static void generateXML(MTObject obj, ContentHandler contentHandler)
     throws SAXException {
         final AttributesImpl ai = new AttributesImpl();
-        addAttribute(ai, "ocdref", obj.getOcdref());
+        IOUtils.addAttribute(ai, "ocdref", obj.getOcdref());
         contentHandler.startElement(NAMESPACE_URI, OBJECT_ELEMENT, OBJECT_ELEMENT_QNAME, ai);
         contentHandler.endElement(NAMESPACE_URI, OBJECT_ELEMENT, OBJECT_ELEMENT_QNAME);
     }
-
-    /**
-     * Helper method to add an attribute.
-     * This implementation adds a new attribute with the given name
-     * and value. Before adding the value is checked for non-null.
-     * @param ai    The attributes impl receiving the additional attribute.
-     * @param name  The name of the attribute.
-     * @param value The value of the attribute.
-     */
-    protected static void addAttribute(AttributesImpl ai, String name, Object value) {
-        if ( value != null ) {
-            ai.addAttribute("", name, name, "CDATA", value.toString());
-        }
-    }
-
 }
