code: @SuppressWarnings("unused")
  	public static String convertDomToString( Document doc)  throws CloudException, InternalException{
  		try {
  			 if(doc == null) return null;
  			 StringWriter stw = new StringWriter();
  	         Transformer serializer = TransformerFactory.newInstance().newTransformer();
  	         serializer.transform(new DOMSource(doc), new StreamResult(stw));
  	        if(stw != null){
  	        	return stw.toString();
  	        }
  	        return null;
  		} catch (TransformerConfigurationException e) {			
  			throw new InternalException(e);
  		} catch (TransformerFactoryConfigurationError e) {
  			throw new InternalException(e);
  		} catch (TransformerException e) {
  			throw new InternalException(e);
  		}
  	}
docs: Convert a xml document to string