/** * Deletes a tag from the document by index. * * @param index The index of the tag to delete. */ public void deleteTag(int index) { E nthTagNode = getNthTagNode(index); doc.deleteNode(nthTagNode); }
/** * Adds a tag to the document. * * @param tagName The name of the tag. * @param i The index at which to insert the tag. */ public void addTag(String tagName, int i) { E node = getNthTagNode(i); El<N> point = Point.<N>inElement(doc.getDocumentElement(), node); XmlStringBuilder xml = getXmlFor(tagName); doc.insertXml(point, xml); }