Getting a White Space after XML Transformation

Many of you might have come across a situation where you transformed an XML file using XSL and finally when you get the output, you find there are some white spaces appearing in certain places. It might be quite frustrating at times especially when you feel that you have done everything possible to make it work correctly.

There is a reason why this is happening. We know that we have to create templates in order for the XML to get transformed. But there are some tags in XML which do not have templates. There could be many, some of them are- <Rows>, <dsQueryResponse>. So for the ones which do not have a template, XSL generates a white space for that particular line of code. Sound’s weird Right?? But that is unfortunately how it works.