{
  void addParentNode(Node context, Collection acc, boolean recurse)  {    Node parent = (context.getNodeType() == Node.ATTRIBUTE_NODE) ?      ((Attr) context).getOwnerElement() : context.getParentNode();    if (parent != null)      {        acc.add(parent);        if (recurse)          {            addParentNode(parent, acc, recurse);          }      }  }