Set attributes in PHP objects.

If there are any attributes in the XML response from the API, these are
now set in the PHP object.
Merge branch 'attributes' into develop