private List<Directive> parseUIControl(Element searchIn) {
        List<Directive> directives = new ArrayList<Directive>();

        /* First we get all the uicontrols because that is the root of a user action */
        try {

            NodeList uiControls = (NodeList) XMLUtils.getExpr((".//uicontrol")).evaluate(searchIn, XPathConstants.NODESET);

            Action foundAction;
            Element uiControl;
            for(int i = 0; i < uiControls.getLength();i++){
                uiControl = (Element)uiControls.item(i);
                foundAction = attemptToFindAction(uiControl);

                switch(foundAction){

                    case CLICK:

                        directives.add(generateClickDirective(uiControl));
                        break;
                    case SEND_TEXT:

                        directives.add(generateSendTextDirective(uiControl));
                        break;
                    default:

                        break;
                }
            }

        } catch (XPathExpressionException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }

        return directives;
    }