Verify XML using XSD

Story

Your company get xml file outside (from partners) and process them using xslshowing data on a web page. You don't want your page to be broken in case xml file is invalid. So you wrote an XSD file against which you verify xml files from partners

Task

  1. Use this xml file to build up an xsd file.
  2. Use an example code below to build up a PHP file that will verify xml against xsd. It should return a web page with error if xml files doesn't correspond to xsd, otherwise should return "xml is valid."