next element in document order?

next element in document order?

Is there a way to get the next element in document order?

For example I want to get the next "<a>" element, whether it's a sibling, descendant of a sibling, or ancestor's sibling