The use of [0] in the answer by invertedSpear is not actually referencing the XMLList index, it is indicating the position of the child to access of the selected node. For comparison
textElements.(@position==columnIndex).appendChild("anyString");
This will do the same thing as invertedSpear's answer, but will add a child to the selected node, rather than accessing the child node directly by index. A node, if it exists, will always have the child indexed at 0 available, in this case it refers to the value of the node itself.
Consider the following:
var xml:XML = <root><node position="1" /><node position="2" /><node position="3" ><subnode>Test1</subnode><subnode>Test2</subnode></node></root>;
var c:XMLList = xml.children();
trace(c);
c.(@position == 1)[0] = "first test";
c.(@position == 2).appendChild("SECOND TEST");
c.(@position == 3)[1] = 'FINAL_test';
trace(c);
trace(c[0][0]);
The first one will work, as shown. The second one will also work, as shown. The third, however, will fail because the node with position == 3 does not have a child at index 1. Notice that this will work...
c.(@size == 3).children()[1] = 'NEW test';
trace(c);