The XML hacking you are talking about is not supported by Tableau. It works though in most of the cases.
If you want to do this by the book, try to look at Document API.
By the way, did you try dropping the new table on the top of old table in data preparation window?
Thanks for your quick response! I completely agree with you that the XML hacking is not a right approach. Dropping a new table on top of the old table generally works but my scenario is little different. I have two tables with few columns that have identical names such as Category, Segment etc. The tableau assigns a unique name to the common fields by appending the table name. For example, Category (Table2), Segment (Table2) etc. In this scenario if you try to replace Table2 with new table such as Table2_New by dropping it on the existing table, the identical fields in table 2 are appended with new table name. For example, Category (Table2_New), Segment (Table2_New). Due to this, the references to those common fields are lost as Tableau is unable to find these fields with names such as Category (Table2), Segment (Table2) etc. These fields no longer exist. I hope this helps. Please let me know if you still have any query or if I could not explain the scenario correctly.
Thanks for your response! My data source has two database tables with relationship (joins) defined. Both tables have few columns that are identical in names. Hence the option you suggested does not work. Please read my answer to Sharad for more info. Let me know if you still have any queries or you need more info.