The Serialization API depends on Symfony's Serializer component.
Serializer's separation of concerns
The serializer splits the work into two steps. First, it will normalize the object to an array. Then it will encode that array into the requested format.
This work is split across two interfaces, the NormalizerInterface and the EncoderInterface. When a Serializer is created, all of the Normalizer objects which might be necessary to handle the data are passed in, as well as all of the relevant Encoder objects.
$encoders = array(new XmlEncoder(), new JsonEncoder());
$normalizers = array(new ComplexDataNormalizer(), new ListNormalizer(), new TypedDataNormalizer());
$serializer = new Serializer($normalizers, $encoders);