The first ruins all brackets it encounters, escaping them.
That's what XML serialization is about; everything else would be invalid. Once again, you may want to switch to "text" as output method to avoid escaping:
http://docs.basex.org/wiki/Serialization
Christian