Update add by xpath.  Fix a potential stackoverflow error.