Bookmark and Share

XML Tree - Sibling

A sibling relationship exists when two elements have the same parent. There are no brothers or sisters in XML, only siblings.

Advertise on

Finding Your Siblings

To find siblings in an XML document, look for elements that are on the same level of the tree and have the same parent.

Who is the sibling of snack?

XML Code, lemonade.xml:


drink is the sibling of snack.

If you look at the tree structure, you can clearly see that the elements drink and snack, of the lemonade.xml document, share the same parent, inventory.

XML Tree:

Bookmark and Share

Download's XML Book

If you would rather download the PDF of this tutorial, check out our XML eBook from the store.

Found Something Wrong in this Lesson?

Report a Bug or Comment on This Lesson - Your input is what keeps Tizag improving with time!

Advertise Here

More Tutorials!
Microsoft Office Tutorials Artist Tutorials