Hi, This would broaden the scope of jaxen a bit, but I hope I can add it here. I've designed an Updater interface, analogous to the Navigator interface. It should allow different implementations for DOM, DOM4J, JDOM, EXML and others to be hidden behind it. The Updater interface allows one to create elements, attributes, text nodes, comments, processing instructions and namespaces. It also has methods to append, insert and remove nodes, as well as set attributes and namespaces on elements. At the moment I have the Updater interface and an implementation for DOM. I haven't found a real standard language for xml updates yet, but there is something somewhat standard at: http://www.xmldb.org/xupdate/xupdate-wd.html I've made an implementation of most of it, that uses a jaxen Navigator to read an XML document that contains update instructions. I won't implement the rename instruction from that spec for now, since most data models for XML I know don't have that feature and it doesn't make sense to me. Apart from that, it's 95% finished. Would it be okay to add this to jaxen? - Erwin
package org.jaxen; /** * */ public interface Updater { Object createComment( Object contextNode, String comment ) throws InvalidContextException; Object createText( Object contextNode, String text ) throws InvalidContextException; Object createElement( Object contextNode, String uri, String qname ) throws InvalidContextException; Object createNamespace( Object contextNode, String prefix, String uri ) throws InvalidContextException; Object createAttribute( Object contextNode, String uri, String qname, String value ) throws InvalidContextException; Object createProcessingInstruction( Object contextNode, String target, String data ) throws InvalidContextException; void insertBefore( Object refNode, Object node ) throws InvalidContextException; void insertAfter( Object refNode, Object node ) throws InvalidContextException; /** * @param position -1 for "at end" */ void appendChild( Object element, Object child, int position ) throws InvalidContextException; void remove( Object node ) throws InvalidContextException; void setAttribute( Object element, Object attribute ) throws InvalidContextException; void setNamespace( Object element, Object namespace ) throws InvalidContextException; Navigator getNavigator(); }