fix null elements with attributes

*null* elements with attributes were being generated as

<element a="one" b="two"></element>

This patch is an attempt to make them come out more like:

<element a="one" b="two"/>