Index: /Users/robheittman/restlet-workspace/restlet/modules/org.restlet/src/org/restlet/resource/DomRepresentation.java
===================================================================
--- /Users/robheittman/restlet-workspace/restlet/modules/org.restlet/src/org/restlet/resource/DomRepresentation.java	(revision 2761)
+++ /Users/robheittman/restlet-workspace/restlet/modules/org.restlet/src/org/restlet/resource/DomRepresentation.java	(working copy)
@@ -142,6 +142,32 @@
     }
 
     /**
+     * Returns the JAXP Transformer object that will be used to serialize
+     * this DOM.  This method may be overridden in order to set custom
+     * properties on the Transformer.
+     * 
+     * @return The transformer to be used for serialization.
+     */
+    protected Transformer getTransformer() throws IOException {
+    	try{
+	        Transformer transformer = TransformerFactory.newInstance()
+	        	.newTransformer();
+	        transformer.setOutputProperty(OutputKeys.METHOD, "xml");
+	
+			if (getDocument().getDoctype() != null) {
+			    transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM,
+			            getDocument().getDoctype().getSystemId());
+			    transformer.setOutputProperty(OutputKeys.DOCTYPE_PUBLIC,
+			            getDocument().getDoctype().getPublicId());
+			}
+			return transformer;
+        } catch (TransformerConfigurationException tce) {
+            throw new IOException("Couldn't write the XML representation: "
+                    + tce.getMessage());
+        }
+    }
+
+    /**
      * Returns a DOMSource.
      * 
      * @return A DOMSource.
@@ -180,16 +206,7 @@
     public void write(OutputStream outputStream) throws IOException {
         try {
             if (getDocument() != null) {
-                Transformer transformer = TransformerFactory.newInstance()
-                        .newTransformer();
-
-                if (getDocument().getDoctype() != null) {
-                    transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM,
-                            getDocument().getDoctype().getSystemId());
-                    transformer.setOutputProperty(OutputKeys.DOCTYPE_PUBLIC,
-                            getDocument().getDoctype().getPublicId());
-                }
-
+                Transformer transformer = getTransformer();
                 transformer.transform(new DOMSource(getDocument()),
                         new StreamResult(outputStream));
             }
