Optimize case for traversables in XML serialization