code: def get_xpath_tuple(xpath):
      
  
      xroot = get_xpath_root(xpath)
      xattr = None
  
      if xroot != xpath:
          xattr = get_xpath_branch(xroot, xpath).strip('@')
  
      return (xroot, xattr)
docs: :return: a tuple with the base of an XPATH followed by any format key or attribute reference