在python中写出以下问题的解决方案:给你两个二进制树root1和root2.想象一下,当你把其中一个树覆盖另一个时,两个树的某些节点叠加,而其他节点则不叠加.你需要将两个树合并为一个新的二进制树.合并规则是,如果两个节点叠加,则结合值作为合并节点的新值.否则,NULL节点将被用作新树的节点.返回合并树.注意:合并过程必须从两个树的节点开始.
Here's a Python solution:

```
class TreeNode:
    def __init__(self, val=0, left=None, right=None):
        self.val = val
        self.left = left
        self.right = right

def mergeTrees(root1, root2):
    if not root1:
        return root2
    if not root2:
        return root1
    
    root1.val += root2.val
    root1.left = mergeTrees(root1.left, root2.left)
    root1.right = mergeTrees(root1.right, root2.right)
    
    return root1
```

Here's how the solution works:

- We define a class `TreeNode` with a constructor that initializes a node's value, left child, and right child.
- We define a function `mergeTrees` that takes in two binary trees `root1` and `root2` as parameters.
- If `root1` is `None`, we return `root2`. If `root2` is `None`, we return `root1`. This is because if either tree is empty, we want to return the non-empty tree as the merged tree.
- We add the values of `root1` and `root2` together and update the value of `root1`. This will account for any overlap in nodes.
- We recursively call `mergeTrees` on the left and right children of `root1` and `root2`.
- Finally, we return `root1`, which is the merged tree.