public void writeElement(Writer writer) throws IOException
{
if (soapContent instanceof DOMContent)
{
DOMWriter dw = new DOMWriter(writer);
CommonMessageContext ctx = MessageContextAssociation.peekMessageContext();
if (ctx != null && Boolean.TRUE == ctx.get(Constants.DOM_CONTENT_CANONICAL_NORMALIZATION))
{
if (log.isTraceEnabled())
log.trace("Forcing canonical normalization of DOMContent...");
dw.setCanonical(true);
}
dw.print(this);
}
else
{
transitionTo(State.XML_VALID);
soapContent.getXMLFragment().writeTo(writer);