XD-956: Parser refactoring

See https://jira.springsource.org/browse/XD-956