public function sortChildren()
    {
        $nodes = $this->removeNodes('*');
        $args = func_get_args();

        array_unshift($args, null);
        $args[0] =& $nodes;

        call_user_func_array(array(get_class($this), 'sort'), $args);

        foreach ($nodes as $node) {
            $this->appendChild($node);
        }

        return $this;
    }