Add detection for toArray() method in Xml

If values or parameters have `toArray()` use that method to convert the
value into an array. This lets ORM\ResultSet and ORM\Query objects to
interoperate with Xml. It also defines a simple duck type that userland
code can use.
Remove incomplete test that is superseded by Collection changes.
Handle entities and value objects that implement toArray() correctly.

Entities will be values in the collection, and eventually end up in
`_createChild` where they need to be array cast before they can be
serialized into xml.
Remove unused import.
Merge pull request #3542 from cakephp/issue-3538

3.0 Make Xml play nice with the new ORM