module Hpricot::Traverse

def preceding

Find all preceding nodes.
def preceding
  sibs = parent.children
  si = sibs.index(self) 
  return Elements[*sibs[0...si]] 
end