Clean up XML code