I have used javax.xml.transform.Transformer and javax.xml.transform.TransformerFactory and org.w3c.dom.Element and org.w3c.dom.Node to create XML file as per my requirement. Its creating XML successfully. The only problem is :
<MYADDRESS NAME="AA00001">
<ATTN1>a</ATTN1>
<ADDRESS></ADDRESS> // This is empty ADDRESS element/tag.
<STATE>AA</STATE>
<ZIP>1</ZIP>
</MYADDRESS>
The <ADDRESS></ADDRESS> shows in browser as <ADDRESS/> where as in editor like notepad, wordpad it is shown as <ADDRESS><ADDRESS>. I want it to be displayed as <ADDRESS/> when the file is opened in Editor also.
Any idea ? Thanks for help !