# Create an XML sibling

**URL:** https://www.finalbuilder.com/forums/t/create-an-xml-sibling/1748
**Category:** Discussion
**Created:** [May 6, 2011, 4:02am UTC](https://www.finalbuilder.com/forums/t/create-an-xml-sibling/1748 "2011-05-06T04:02:26Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [May 6, 2011, 4:02am UTC](https://www.finalbuilder.com/forums/t/create-an-xml-sibling/1748/1 "2011-05-06T04:02:26Z")

</div>

How can I create an XML node sibling to another node? Using the "Create XML&nbsp;Node" action, one can only create a first child or a last child of a referenced parent node. There appears no way in FB to create a sibling node, which is neither first nor last.

For example, lets say we start with: (your forum editor won't let me use XML angle brackets, so using [] instead. Read [ as angle bracket.)

[doc]  
&nbsp; [el x="1"/]  
&nbsp; [el x="3/]

and we want to add node [el x="2"/] as the next sibling of [el x="1"/] like so:

[doc/]  
&nbsp; [el x="1"/]  
&nbsp; [el x="2"/]  
&nbsp; [el x="3"/]  
[doc/]

&nbsp;

We cant do this in FB using the "Create XML&nbsp;Node" action, but maybe there is another way?

---

<div class="post-metadata">

### Author: ![stephen.ryan](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/f14d63/32.png) [@stephen.ryan](https://www.finalbuilder.com/forums/u/stephen.ryan)
#### Post date: [May 9, 2011, 3:51am UTC](https://www.finalbuilder.com/forums/t/create-an-xml-sibling/1748/2 "2011-05-09T03:51:17Z")

</div>

Hi Sean   
  
 I have added the ability to do this via the Create XML Node action, I will post a new build here shortly.   
  
 Regards,   
 Steve

---

<div class="post-metadata">

### Author: ![stephen.ryan](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/f14d63/32.png) [@stephen.ryan](https://www.finalbuilder.com/forums/u/stephen.ryan)
#### Post date: [May 9, 2011, 6:05am UTC](https://www.finalbuilder.com/forums/t/create-an-xml-sibling/1748/3 "2011-05-09T06:05:49Z")

</div>

Hi Sean   
  
I have added the following options to the New Node Details tab of the Create XML Action:   
- Insert Before Child At XPath   
- Insert After Child At XPath   
  
When you select either of these options you will be able to specify an XPath to the sibling that you would like to reference. For instance you can now insert your node in to the desired by selecting 'Insert After Child At XPath' and providing an XPath as '/doc/el[1]'.   
  
You can download the new build from here:   
https://www.finalbuilder.com/downloads/finalbuilder/aex6/FB700\_1222.exe   
  
Regards,   
Steve

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [May 11, 2011, 1:28am UTC](https://www.finalbuilder.com/forums/t/create-an-xml-sibling/1748/4 "2011-05-11T01:28:58Z")

</div>

Thanks heaps. This is great support.
