class ConditionDescriptorParser implements NodeParser<ConditionDescriptor> {

    @Override
    public ConditionDescriptor parseNode(final Node conDes, final Document document) {
        //This number represents the depth of the subtree
        int depth = 0;
        Condition condition = null;
        if (conDes != null) {
            Element el = (Element) conDes;
            List<Condition> parsedConditions = parseConditions(el.getChildNodes(), document, depth);
            if (!parsedConditions.isEmpty()) {
                condition = parsedConditions.get(0);
            }
        }
        return new ConditionDescriptor(condition);
    }

}