Java tutorial
//package com.java2s; import org.w3c.dom.*; public class Main { /**gets the sibling element of a node * @param start the node to get the sibling of * @return the sibling node*/ public static Node GetNextSiblingElement(Node start) { if (start == null) return start; Node node = start.getNextSibling(); if (node == null) return node; else if (node.getNodeType() != Node.ELEMENT_NODE) return GetNextSiblingElement(node); else return node; } }