response.is_valid? is now idempotent
The validate_doc operation in xml_security.rb was modifying the original document, making the second run fail, so the code now copies the document before modifying it.