protected mxAtomicGraphModelChange[] decodeChanges(Node node)
	{
		// Updates the document in the existing codec
		codec.setDocument(node.getOwnerDocument());

		LinkedList<mxAtomicGraphModelChange> changes = new LinkedList<mxAtomicGraphModelChange>();

		while (node != null)
		{
			Object change;

			if (node.getNodeName().equals("mxRootChange"))
			{
				// Handles the special case were no ids should be
				// resolved in the existing model. This change will
				// replace all registered ids and cells from the
				// model and insert a new cell hierarchy instead.
				mxCodec tmp = new mxCodec(node.getOwnerDocument());
				change = tmp.decode(node);
			}
			else
			{
				change = codec.decode(node);
			}

			if (change instanceof mxAtomicGraphModelChange)
			{
				mxAtomicGraphModelChange ac = (mxAtomicGraphModelChange) change;

				ac.setModel(model);
				ac.execute();

				// Workaround for references not being resolved if cells have
				// been removed from the model prior to being referenced. This
				// adds removed cells in the codec object lookup table.
				if (ac instanceof mxChildChange
						&& ((mxChildChange) ac).getParent() == null)
				{
					cellRemoved(((mxChildChange) ac).getChild());
				}

				changes.add(ac);
			}

			node = node.getNextSibling();
		}

		return changes.toArray(new mxAtomicGraphModelChange[changes.size()]);
	}