{
  void addPrecedingNodes(Node context, Collection acc, boolean recurse)  {    Node cur = context.getPreviousSibling();    while (cur != null)      {        acc.add(cur);        if (recurse)          {            addChildNodes(cur, acc, true);          }        cur = cur.getPreviousSibling();      }    if (recurse)      {        context = (context.getNodeType() == Node.ATTRIBUTE_NODE) ?          ((Attr) context).getOwnerElement() : context.getParentNode();        if (context != null)          {            addPrecedingNodes(context, acc, recurse);          }      }  }