code: @Override
      public void marshal(Object graph, Result result) throws IOException, XmlMappingException {
          @SuppressWarnings("unchecked")
          final Tuple<String, Element> data = (Tuple<String, Element>) graph;
  
          final Transformer transformer;
          try {
              transformer = this.xmlUtilities.getIdentityTransformer();
          } catch (TransformerConfigurationException e) {
              throw new RuntimeException("Failed to load identity Transformer", e);
          }
  
          // Setup the transformer to pretty-print the output
          transformer.setOutputProperty(OutputKeys.INDENT, "yes");
          transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
  
          try {
              transformer.transform(new DocumentSource(data.second), result);
          } catch (TransformerException e) {
              throw new RuntimeException("Failed to write Element to Result for: " + data.first, e);
          }
      }
docs: /* (non-Javadoc)
  @see org.springframework.oxm.Marshaller#marshal(java.lang.Object, javax.xml.transform.Result)