3.0 Make Xml play nice with the new ORM

I think this is a simple/contained way to fix #3538. Instead of modifying the view like in #3540, I've updated the underlying utility class.

Because PHP doesn't let you do instanceof on traits, I've decided to use the `toArray` method as a duck type for interacting with Xml.