code: public static int getPosition(Element e) {
  
          NodeList<Node> childNodes = e.getParentElement().getChildNodes();
          for (int i = childNodes.getLength(); i >= 0; i--) {
              if (childNodes.getItem(i) == e) {
                  return i;
              }
          }
          return -1;
      }
docs: Returns the element position relative to its siblings.<p>
  
  @param e the element to get the position for
  
  @return the position, or <code>-1</code> if not found