Hi kagrawal and welcome to the forums!
In general this should work, so this might be an error in the third XHTML node that you add. If you add just that one, do you get the same error message?
Matt Faus / Microsoft InfoPath MVPQdabra® Software / Streamline data gathering to turn process into knowledge