Honor toJSON/toXML() for XML support