The API documentation says that once a document has been stored with a docname, that name cannot be updated (see method setDocName() in TXMLObject).
Also, if a document has both ino:id and a document name, the ino:id “takes precedence”. Any supplied docname is ignored on the update, and any existing docname is deleted (see method update() in TXMLObjectAccessor).
So to achieve a change of docname you need code like this:
Element element = (Element)xmlObject.getElement();
response = xmlObjectAccessor.delete(xmlObject);
element.removeAttribute("ino:id");
String docname = "Newname";
xmlObject.setDocname( docname );
response = xmlObjectAccessor.insert( xmlObject );
This deletes your existing object, then removes the ino:id attribute from the original document’s xml, and inserts a new document with the same xml content but a new docname.
HTH
#webMethods#webMethods-Tamino-XML-Server-APIs#API-Management