* Nor is it cached; repeated calls repeat the operation.
* @return an XML fragment in a string.
* @throws Exception if anything went wrong
*/
public String getAsString() throws Exception {
SerializationContext serializeContext = null;
StringWriter writer = new StringWriter();
MessageContext msgContext;
if (context != null) {
msgContext = context.getMessageContext();
} else {
msgContext = MessageContext.getCurrentContext();
}
serializeContext = new SerializationContext(writer, msgContext);
serializeContext.setSendDecl(false);
output(serializeContext);
writer.close();
return writer.getBuffer().toString();
}