title: Jackson empty xml array deserialization
body: <p>I have an incoming xml from Recurly service with list of transactions. Sometimes it's empty and looks like this:</p>
  
  <pre><code>&lt;transactions type="array"&gt;
  &lt;/transactions&gt;
  </code></pre>
  
  <p>I need to deserialize this using Jackson. I've tried next mapping</p>
  
  <pre><code>@XmlRootElement(name = "transactions")
  public class TransactionObjectListResponse extends ArrayList&lt;TransactionObjectResponse&gt; { 
  }
  </code></pre>
  
  <p>where TransactionObjectResponse class for each transaction. It works fine for non-empty collections, but fails when no transactions came. Next message appears:</p>
  
  <pre><code>java.lang.IllegalStateException: Missing name, in state: END_ARRAY
  at com.fasterxml.jackson.dataformat.xml.deser.FromXmlParser.getCurrentName(FromXmlParser.java:310)
  at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:289)
  at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeOther(BeanDeserializer.java:157)
  at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:123)
  at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:230)
  at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:207)
  at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:23)
  at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:2888)
  at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2034)
  </code></pre>
  
  <p>I used XmlMapper directly,</p>
  
  <pre><code>xmlMapper.readValue(responseXml, TransactionObjectListResponse.class);
  </code></pre>
  
  <p>Response entity structure isn't strict, any help would be appricated. Thanks.</p>