code: protected static List<Element> getElements(final Element parent, final String tagName) {
          List<Element> elements = new ArrayList<Element>();
          NodeList nodes = parent.getElementsByTagName(tagName);
          for (int i = 0; i < nodes.getLength(); i++) {
              org.w3c.dom.Node node = nodes.item(i);
              if (node instanceof Element) {
                  elements.add(Element.class.cast(node));
              }
          }
          return elements;
      }
docs: Finds child elements in DOM.
  @param parent The Element to find in
  @param tagName The element to find
  @return List of elements