code: public static void verifyNode(Node node, String expected)
      {
          if (node == null)
          {
              throw new XmlException(
                  "Did not find <"+expected+"> node");
          }
          if (!node.getNodeName().equalsIgnoreCase(expected))
          {
              throw new XmlException(
                  "Expected <"+expected+"> tag, " +
                  "but found <"+node.getNodeName()+">");
          }
      }
docs: Verify that the given node is not <code>null</code>, and that its
  name matches the expected tag name (ignoring upper/lowercase),
  and throw an XmlException if this is not the case.
  
  @param node The node
  @param expected The expected tag name
  @throws XmlException If the node is <code>null</code>, or the
  node name does not match the expected name