Stop doing too many things at the same time.
First make sure the SQL works, and *only then* start messing with XML parsing. Show the results, input, output -- not just the program.
Change the program to just "hard-code" some values into the table. Only when that has become reliable make a program that parses the xml (without any database). Only when the two parts separately are both reliable merge them into your final program.
Also, please show both input and output of programs. Nobody can know what you are doing wrong without that.