private function sortChildren()
{
$shouldSort = false;
foreach ($this->immediateChildren as $child) {
// NOTE: This include alternative parts moved into a related part
if ($child->getNestingLevel() == self::LEVEL_ALTERNATIVE) {
$shouldSort = true;
break;
}
}
// Sort in order of preference, if there is one
if ($shouldSort) {
usort($this->immediateChildren, array($this, 'childSortAlgorithm'));
}
}