Code example for DOMSource

	public final Document transform(final Document sourceMessage)
			throws TransformerException { 
		try { 
			final DOMSource source = new DOMSource(sourceMessage);
			Document result;
			DOMResult target = new DOMResult();
			target = (DOMResult) super.transform(source, target);
			result = (Document) target.getNode();
			if (NullChecker.isEmpty(result)) {
				throw new TransformerException("Empty output from transformer!");
			return result;
		} catch (final javax.xml.transform.TransformerException ex) {
			throw new TransformerException(ex);
Connect your IDE to all the code out there  Get Codota for Java