Added ACTIVE XML write if clause