fixes #411 - xml output was reversed