Well unless you have a pre-existing template for the XHTML and you only need to fill in a few placeholders you've probably got a lot of work on your hands. A better tool for the job would probably be XSLT whereby one document is transformed into another. If you haven't worked with XSLT before you're going to need to sit down and learn for a few days until you can tackle anything but the simplest jobs.
If XSLT is not an option then you are going to have to give more details such as what is the structure of your input, what does the output look like and how one maps to the other and what XML tools are you using, Java, .NET etc.
Joe (Microsoft MVP - XML