public RulesProfile parse(Reader reader, ValidationMessages messages) {
RulesProfile profile = RulesProfile.create();
SMInputFactory inputFactory = initStax();
try {
SMHierarchicCursor rootC = inputFactory.rootElementCursor(reader);
rootC.advance(); // <profile>
SMInputCursor cursor = rootC.childElementCursor();
while (cursor.getNext() != null) {
String nodeName = cursor.getLocalName();
if (StringUtils.equals("rules", nodeName)) {