From the docs :
QDomNodeList QDomElement::elementsByTagName ( const QString & tagname ) const
Returns a QDomNodeList containing all descendent elements of this element that are called tagname. The order they are in the node list is the order they are encountered in a preorder traversal of the element tree.
so the behaviour of elementsByTagName in ur code is justified.

As for the childNodes(), Are you sure you were on the <Container name="L1Container" autoAdd="true"> tag when you used the childNodes() function ??

Thirdly... what is iChild in your code ? How are you assigning value to it ??