if(namespaceURI.equals(XUPDATE_NS)) { if(localName.equals("element")) { stack.pop(); } else if(localName.equals("attribute")) inAttribute = false; if(localName.equals("append") || localName.equals("remove") || localName.equals("insert-before") || localName.equals("insert-after")) { inModification = false; modification.setContent(fragment); modifications.add(modification); modification = null; } } else if(inModification) stack.pop();
if (inModification && charBuf.length() > 0) { final String normalized = charBuf.getNormalizedString(FastStringBuffer.SUPPRESS_BOTH); if (normalized.length() > 0) { Text text = doc.createTextNode(normalized); if (stack.isEmpty()) { LOG.debug("appending text to fragment: " + text.getData()); fragment.appendChild(text); } else { Element last = (Element) stack.peek(); last.appendChild(text); } } charBuf.setLength(0); } if (namespaceURI.equals(XUPDATE_NS)) { if (localName.equals("element")) { stack.pop(); } else if (localName.equals("attribute")) inAttribute = false; if (localName.equals("append") || localName.equals("remove") || localName.equals("insert-before") || localName.equals("insert-after")) { inModification = false; modification.setContent(fragment); modifications.add(modification); modification = null; } } else if (inModification) stack.pop();
	public void endElement(String namespaceURI, String localName, String qName)		throws SAXException {        if(namespaceURI.equals(XUPDATE_NS)) {            if(localName.equals("element")) {                stack.pop();            } else if(localName.equals("attribute"))                inAttribute = false;            if(localName.equals("append") ||                localName.equals("remove") ||                localName.equals("insert-before") ||                localName.equals("insert-after")) {                inModification = false;                modification.setContent(fragment);                modifications.add(modification);                modification = null;            }        } else if(inModification)            stack.pop();	}