# Writing XML

**URL:** <https://forum.kirupa.com/t/writing-xml/302834>\
**Category:** flash\
**Created:** [January 8, 2010, 9:51am UTC](https://forum.kirupa.com/t/writing-xml/302834 "2010-01-08T09:51:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![colazo](https://avatars.discourse-cdn.com/v4/letter/c/4da419/32.png) [@colazo](https://forum.kirupa.com/u/colazo)\
**Post date:** [January 8, 2010, 9:51am UTC](https://forum.kirupa.com/t/writing-xml/302834/1 "2010-01-08T09:51:24Z")

</div>

hello. Im wondering if I can add to the following example:

```auto
var xml:XML = 
        <foo>
            <bar>text1</bar>
            <bar>text2</bar>
        </foo>;

```

another  
\<bar\>text1\</bar\>  
tag.  
How do I do it? And how do I reference it and not reference the other similar tags if I DONT KNOW the number of them?  
For example how can I change the “text” of a bar if I dont know the number of the bar tags?
