var d=app.activeDocument.xmlElements.item(0); var nxt=d.xmlElements.previousItem(d.xmlElements.item(1)); alert(nxt.characters.length);