title: Deserialize xml to object with Symfony2
body: <p>I collect some data in xml format through an API and would like to deserialize it in an objects list.
  I'm using Symfony2 and find out JMSSerializerBundle but I do not really know how to use it.</p>
  
  <p>I know that Sf2 allows to serialize/deserialize object to/from array, but I'm looking for something more specific.
  For example, for this class :</p>
  
  <pre><code>class Screenshot
  {
      /**
       * @var integer $id
       */
      private $id;
  
      /**
       * @var string $url_screenshot
       */
      private $url_screenshot;
  
  
      public function __construct($id, $url_screenshot) {
          $this-&gt;id = $id;
          $this-&gt;url_screenshot = $url_screenshot;
      }
  
  
      /**
       * Get id
       *
       * @return integer 
       */
      public function getId()
      {
          return $this-&gt;id;
      }
  
      /**
       * Set url_screenshot
       *
       * @param string $urlScreenshot
       */
      public function setUrlScreenshot($urlScreenshot)
      {
          $this-&gt;url_screenshot = $urlScreenshot;
      }
  
      /**
       * Get url_screenshot
       *
       * @return string 
       */
      public function getUrlScreenshot()
      {
          return $this-&gt;url_screenshot;
      }
  
      /**
       * Serializes the Screenshot object.
       *
       * @return string
       */
      public function serialize()
      {
          return serialize(array(
              $this-&gt;id,
              $this-&gt;url_screenshot
          ));
      }
  
      /**
       * Unserializes the Screenshot object.
       *
       * @param string $serialized
       */
      public function unserialize($serialized)
      {
          list(
              $this-&gt;id,
              $this-&gt;url_screenshot
          ) = unserialize($serialized);
      }
  
      public function __toString() {
          return "id: ".$this-&gt;id
                ."screenshot: ".$this-&gt;url_screenshot;
      }
  }
  </code></pre>
  
  <p>I would like serializing/deserializing to/from this kind of xml :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;screenshots&gt;
     &lt;screenshot&gt;
        &lt;id&gt;1&lt;/id&gt;
        &lt;url_screenshot&gt;screenshot_url1&lt;/url_screenshot&gt;
     &lt;/screenshot&gt;
     &lt;screenshot&gt;
        &lt;id&gt;2&lt;/id&gt;
        &lt;url_screenshot&gt;screenshot_url2&lt;/url_screenshot&gt;
     &lt;/screenshot&gt;
     &lt;screenshot&gt;
        &lt;id&gt;3&lt;/id&gt;
        &lt;url_screenshot&gt;screenshot_url3&lt;/url_screenshot&gt;
     &lt;/screenshot&gt;
  &lt;/screenshots&gt;
  </code></pre>
  
  <p>I really want to use something integrated/to integrate in Sf2 (something "smooth") and prefer avoiding any homemade xml parsers.</p>