Correct spec to xml, add tests.