4.3 Same–Name Siblings

A particular node may, in some cases, have same-name siblings, that is, other nodes that share its parent and have the same name. Whether a particular node allows this depends on the child-node definition that applies to it (this definition is part of the node type of that node’s parent, see section 6.7 Node Types).

The standard method for retrieving a set of such nodes is Node.getNodes(String namePattern) which returns an iterator over all the child nodes of the calling node that have the specified pattern (by making namePattern just a name, without wildcards, we can get all the nodes with that exact name, see section 6.2.3 Node Read Methods).