code: private static void getConditionNodes(final Node node, final Map<Node, List<String>> conditionalNodes) {
          final NamedNodeMap attributes = node.getAttributes();
          if (attributes != null) {
              final Node attr = attributes.getNamedItem("condition");
  
              if (attr != null) {
                  final String conditionStatement = attr.getNodeValue();
  
                  final String[] conditions = conditionStatement.split("\\s*(;|,)\\s*");
  
                  conditionalNodes.put(node, Arrays.asList(conditions));
              }
          }
  
          // Check the child nodes for condition attributes
          final NodeList elements = node.getChildNodes();
          for (int i = 0; i < elements.getLength(); ++i) {
              getConditionNodes(elements.item(i), conditionalNodes);
          }
      }
docs: Collects any nodes that have the "condition" attribute in the
  passed node or any of it's children nodes.
  
  @param node             The node to collect condition elements from.
  @param conditionalNodes A mapping of nodes to their conditions