Freemarker node Siblings

I am trying to access the previous and next sibling of a node that exists in the same folder. I am trying to do with with the freemarker language. Does any one have any idea how to do this rather than list all child nodes of the parent. Iterate through all and check against the current nodes id and the current node's id in the list? I keep reading about functions like "following-sibling" with xpath but I have no idea how to use it or even if it is accessible via freemarker.