/// <summary>
        /// Clones this instance.
        /// </summary>
        /// <returns>The new node.</returns>
        internal ProductPartitionNode Clone()
        {
            ProductDimension newDimension = null;

            if (this.Dimension != null)
            {
                newDimension = (ProductDimension)SerializationUtilities.CloneObject(
                    this.Dimension);
            }
            ProductPartitionNode newNode = new ProductPartitionNode(null, newDimension,
                                                                    this.ProductPartitionId, this.children.Comparer);

            newNode = CopyProperties(this, newNode);
            newNode.CloneChildrenFrom(this.Children);
            return(newNode);
        }
        /// <summary>
        /// Deeply clones each child in <paramref name="children"/> and attaches it
        /// to <paramref name="newParent"/>.
        /// </summary>
        /// <param name="newParent">The new parent to which the cloned children
        /// will be added</param>
        /// <param name="children">The children to clone</param>
        /// <param name="minimumId">The minimum ID to compare to.</param>
        /// <returns>The minimum product partition ID found within the subtrees
        /// under <paramref name="children"/>.</returns>
        private void CloneChildrenFrom(IEnumerable <ProductPartitionNode> children)
        {
            foreach (ProductPartitionNode childNode in children)
            {
                if (!this.IsSubdivision)
                {
                    this.AsSubdivision();
                }

                // Clone the child and add it to newParent's collection of children.
                ProductDimension newDimension = (ProductDimension)SerializationUtilities.CloneObject(
                    childNode.Dimension);
                ProductPartitionNode newChild = this.AddChild(newDimension);
                newChild = CopyProperties(childNode, newChild);

                newChild.CloneChildrenFrom(childNode.Children);
            }
        }
    /// <summary>
    /// Clones this instance.
    /// </summary>
    /// <returns>The new node.</returns>
    internal ProductPartitionNode Clone() {
      ProductDimension newDimension = null;

      if (this.Dimension != null) {
        newDimension = (ProductDimension) SerializationUtilities.CloneObject(
         this.Dimension);
      }
      ProductPartitionNode newNode = new ProductPartitionNode(null, newDimension,
            this.ProductPartitionId, this.children.Comparer);
      newNode = CopyProperties(this, newNode);
      newNode.CloneChildrenFrom(this.Children);
      return newNode;
    }