Is there a way to serialize struct to XML or plain text?

In a soap return i get a big struct with many levels and fields.

Or can i perhaps hook up the return from the soap response where the returnvalue is bound to the struct?

This is for logging in a