Again, have you tried it? There are thousands of articles and documentation pages on the internet that explain how to do these things. Unless you have tried something already and are having an particular problem, I'm not going to just repeat what is already out there.
There's not anything terribly special about serializing a "complex" object. You serialize it and the serialization logic serializes everything underneath it. There are settings and attributes used to control/change how the serialization behaves. But ultimately, serializing a integer or a large object tree hierarchy amounts to the same thing, a stream of XML.
Please try some things and be more explicit with your questions. We are here to help by providing answers to discreet questions, not to provide complete solutions to vague requests. If you are looking for the latter, please try tutorials or books.
-
Peter