input: Write a python function to read XML data and insert it into a MySQL database.
  assert insert_xml_to_db('mytest.xml', 'mytable', db) == True
  assert insert_xml_to_db('nonexistent.xml', 'mytable', db) == False
  assert insert_xml_to_db('mytest.xml', 'nonexistent_table', db) == False
output: import xml.etree.ElementTree as ET
  import mysql.connector
  from mysql.connector import errorcode
  
  def insert_xml_to_db(xml_file, table_name, db_config):
      try:
          # Parse the XML file
          tree = ET.parse(xml_file)
          root = tree.getroot()
          
          # Establish a MySQL connection
          cnx = mysql.connector.connect(**db_config)
          cursor = cnx.cursor()
          
          # Get table column names and values from XML
          columns = [elem.tag for elem in root[0]]
          
          for child in root:
              values = [child.find(col).text for col in columns]
              
              # Create placeholders for the values
              placeholders = ', '.join(['%s'] * len(values))
              
              # Create the SQL query to insert data
              query = f"INSERT INTO {table_name} ({', '.join(columns)}) VALUES ({placeholders})"
              
              # Execute the query
              cursor.execute(query, values)
          
          # Commit the transaction
          cnx.commit()
          cursor.close()
          cnx.close()
          return True
      
      except FileNotFoundError:
          return False
      except ET.ParseError:
          return False
      except mysql.connector.Error as err:
          if err.errno == errorcode.ER_NO_SUCH_TABLE:
              return False
          else:
              return False