/* Returns 0 to abort the walk or 1 to continue  */
static int xmlWalkRemoveRef(const void *data, const void *user)
/* Returns 0 to abort the walk or 1 to continue  */
static int xmlWalkRemoveRef(const void *data, const void *user)
{
    xmlAttrPtr attr0 = ((xmlRefPtr)data)->attr;
    xmlAttrPtr attr1 = ((xmlRemoveMemoPtr)user)->ap;
    xmlListPtr ref_list = ((xmlRemoveMemoPtr)user)->l;
    if (attr0 == attr1) {
        xmlListRemoveFirst(ref_list, (void *)data);
        return 0;
    }
    return 1;
}