Fixed fatal error for XML and XHTML export (#614)