I was not able to reproduce the described exception in a unit test either in the Confluence XHTML parser or the XML input filter.