Hi Hussein, What the command below does it pretty obvious to you, I'm sure. What's not obvious to me is how to recurse the command so that rather than just adding a new "state" element to the first "signal" element, it adds a new "state" element to every "signal" element in the document.
There's no easy way of doing this, is there? <commandname="insertStateNames"> ?? <macroundoable="true"repeatable="true"> ?? <sequence> ????? <getexpression="join(//pmc:testComponent/pmc:states/pmc:state/@name, ' ')"/> ????? <commandname="pick" ????? parameter="'Choose state:' false %_"/> ????? <setvariable="attvalue"expression="%_"plainString="true"/> ????? <commandname="xpathSearch"parameter="//ns:signal/ns:state[last()]"/> ????? <commandname="insertNode"parameter="sameElementAfter[implicitElement]"/> ????? <getexpression="$attvalue"/> ????? <commandname="putAttribute"parameter="name '%_'" /> ??? </sequence> ? </macro> </command> ? ? Cheers, Jeff.

