XSD validation added, some improvements