My first reaction would be that manipulating XML node trees is much better done in XSLT than in Java, so calling extension functions in order to do node manipulation seems very strange. In particular, "adding an additional text node as a child" is what XSLT was designed to do, so it seems very odd to call Java to do it.
Any code you do write in Java to manipulate nodes is going to be dependent on the tree model used. From the error message, it sounds as if you're probably building the tree initially using Saxon's TinyTree model, and then wrapping the TinyTree nodes in a DOM wrapper for the benefit of your Java code. The DOM wrapper will give you a DOM interface for retrieval/navigation, but not for update, because the TinyTree is immutable.