title: Flex - XML Serialization and De-Serialization of nested Object structures
body: <p>Our Flex app would like to work with requests and responses as object graphs (nothing unusual there) e.g. response becomes the model of some view, and would be a structure with several layers of nesting.</p>
  
  <p>** Now, ideally we would like to use the same client (and server) side objects for different message formats e.g. XML and AMF, and have a pluggable serialization/de-serialization layer (!)</p>
  
  <p>AMF has serialization and matching of client to server using
      [RemoteClass(alias="samples.contact.Contact")]
  but it seems there is no equivalent for XML.</p>
  
  <p>I am (somewhat optimistically) looking for a neat way of serializing the object graph to XML, to send through a HTTPService from the client.</p>
  
  <p>For responses, the default 'object' and 'E4X' provide some de-serialization. This is handy, but of course we don't have the niceties of unpacking the XML back into specific AS classes like we do with AMF.</p>
  
  <p>Any suggestions?
  (did have one idea come through about wrapping/casting object as XML or XMLList - this does not seem to work, however)</p>
  
  <p>Update:</p>
  
  <p>Both these libraries look useful, and I will very likely use them at some point.</p>
  
  <p>For now, I really need the simplicity of re-using the metadata set for the AMF3 serialization which we are using in any case ([RemoteClass],[Transient])</p>
  
  <p>.. so the best option at the moment is AMFX - used Flex Data Services for AMF transfer using XML - classes in mx.messaging.channels.amfx package - only drawback at the moment is any Externalizable class is transformed into a Hex byte stream - and ArrayCollection is Externalizable! (hoping to workaround by serializing the internal Array in a subclass ..)</p>
  
  <p>Hope that's useful to someone ..</p>