Here you can find the source of getPreHomoSibling(Node aNode)
public static Node getPreHomoSibling(Node aNode)
//package com.java2s; //License from project: Apache License import org.w3c.dom.Node; public class Main { public static Node getPreHomoSibling(Node aNode) { Node preSibling = aNode;//from w w w. j a v a2 s. com while ((preSibling = preSibling.getPreviousSibling()) != null) { if (preSibling.getNodeName().equals(aNode.getNodeName())) { return preSibling; } } return null; } }