<?xml version="1.0"?>
... it has ignored the closing tag ...What is "it" in that statement? How exactly are you constructing the XML document?
For example,
<tag1>
<tag2>Some Value</tag2>
<tag3 isNull="false" />
<tag4>Some other Value</tag4>
</tag1>
becomes
<tag1>
<tag2>Some Value</tag2>
<tag3 isNull="false">
<tag4>Some other Value</tag4>
</tag3>
<tag3 isNull="false"></tag3>
</tag1>