Change action of endElement().

Action of this function is the same as endObject().
So, this function is wrapper function of endObject().