For question 1, have you tried the Graphical XML Side-By-Side Comparison Assertion?
This assertion might help you compare an expected XML to the XML response. You could read the expected XML from a dataset, and store this value in a property to handle the situation where your XML is changing as a result of a loop. Rather than loading the XML from a file, use the {{ }} property notation for your expected value. Use the Settings Tab to define configurations according to your requirements.
For XML validation against WSDL, you might see if the Ensure XML Validation Assertion will work.
For XSD validation, a scripted approach may or may not help you. Not sure if the following would solve your issue or not.
NOTE: Non-verified/untested sample code:
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;
import javax.xml.validation.Validator;
// set these values accordingly
// XMLShema is a variable that holds the text of the XSD file
// XMLData is a variable that holds the text of the XML document to validate
try {
SchemaFactory factory = SchemaFactory.newInstance( "http://www.w3.org/2001/XMLSchema" );
Schema schema = factory.newSchema( new StreamSource( new StringReader( XMLSchema ) ) );
Validator validator = schema.newValidator();
Source source = new StreamSource( new StringReader( XMLData ) );
validator.validate( source );
_logger.info("schema check successful");
}
catch ( SAXParseException ex ) {
// TO DO: Trap Logic
}