Sorry that was a cut and paste mistake.
The snippet I posted is part of a much larger file. Most elements are converted to hashes and arrays but there are several which are empty.
I did try reading and printing with LibXML and it did read the processing instructions and the "empty elements" that Simple had were properly completed.
So perhaps that is a better alternative ....