code: protected void assertNodeName(Node pNode, String ... pExpected)  {
          for (String expected : pExpected) {
              if (pNode.getNodeName().equals(expected)) {
                  return;
              }
          }
          StringBuilder buffer = new StringBuilder();
          for (int i=0; i < pExpected.length; i++) {
              buffer.append(pExpected[i]);
              if (i < pExpected.length-1) {
                  buffer.append(",");
              }
          }
          throw new SecurityException(
                  "Expected element " + buffer.toString() + " but got " + pNode.getNodeName());
      }
docs: Verify that a given node has one of a set of expected node names
  
  @param pNode node to check
  @param pExpected list of expected node names
  @throws SecurityException if the node has none of the expected names