private static ExternalFinderItemCommand generateFinderCommand(Node commandNode) {
        String command = commandNode.getTextContent();
        ExternalFinderItem.TARGET target = ExternalFinderItem.TARGET.BOTH;
        ExternalFinderItem.ENCODING encoding = ExternalFinderItem.ENCODING.NONE;
        String delimiter = "|";

        if (commandNode.hasAttributes()) {

            Node tAttribute = commandNode.getAttributes().getNamedItem("target");
            if (tAttribute != null) {
                String targetAttribute = tAttribute.getTextContent().toLowerCase();
                if (targetAttribute.equals("ascii_only")) {
                    target = ExternalFinderItem.TARGET.ASCII_ONLY;
                } else if (targetAttribute.equals("non_ascii_only")) {
                    target = ExternalFinderItem.TARGET.NON_ASCII_ONLY;
                }
            }

            Node eAttribute = commandNode.getAttributes().getNamedItem("encoding");
            if (eAttribute != null) {
                String encodingAttribute = eAttribute.getTextContent().toLowerCase();
                if (encodingAttribute.equals("default")) {
                    encoding = ExternalFinderItem.ENCODING.DEFAULT;
                } else if (encodingAttribute.equals("escape")) {
                    encoding = ExternalFinderItem.ENCODING.ESCAPE;
                }
            }

            Node dAttribute = commandNode.getAttributes().getNamedItem("delimiter");
            if (dAttribute != null) {
                delimiter = dAttribute.getTextContent();
            }
        }

        return new ExternalFinderItemCommand(command, target, encoding, delimiter);
    }