public void endElement(final String nameSpace, final String localName, final String fullName) throws SAXException { final int n_kids = this.kid_stack.size() - this.count_stack.pop(); final Object[] kids = new Object[n_kids]; for (int i = n_kids - 1; i >= 0; i -= 1) { kids[i] = this.kid_stack.removeLast(); } final FatMutableXmlElement e = (FatMutableXmlElement) this.open_stack.removeLast(); e.addChildren(Arrays.asList(kids)); this.kid_stack.addLast(e); }