How can I make empty tags self-closing with Nokogiri?
I've created an XML template in ERB. I fill it in with data from a database during an export process. In some cases, there is a null value, in which case an element may be empty, like this: <someitem> </someitem> In that case, the client receiving the export wants it to be converted into a self-closing tag: <someitem/> I'm trying to see how to get Nokogiri to do this, but I don't see it yet. Does anybody know how to make empty XML tags self-closing with Nokogiri? Update A regex was sufficient to do what I specified above, but the client now also wants tags whose children are all empty to be