That's not exactly what it was meant to do....
However, I'm interested to know why you want to serialize the object to XML. If you want to use Mendix to interact with other systems, I'd suggest you use SOAP (which serializes everything to XML under the hood).
If you want to serialize the objects for storage in xml files I'd recommend using your own xml serializer (or one of the libraries that's included with the mendix runtime). That way you have full control over the format in which the objects are stored.
Thanks to Jasper I've been able to solve my issue by giving me an XMLExporter. I need this for being able to use XSLT to generate nicely formatted HTML (as the Mendix templating mechanism doesn't provide enought features to create HTML we need).
Thanks for your answer!