Fix toQuery() and toXml() not referencing this.obj