code: def patch_text(actions, tree):
      
      tree = etree.fromstring(tree)
      actions = patch.DiffParser().parse(actions)
      tree = patch_tree(actions, tree)
      return etree.tounicode(tree)
docs: Takes a string with XML and a string with actions