You don’t want to use this class. Really. Use XPath, which is a wrapper for this class. Believe me. You don’t want to poke around in here. There is strange, dark magic at work in this code. Beware. Go back! Go back while you still can!
ELEMENTS = [ :element ]
ALL = [ :attribute, :element, :text, :processing_instruction, :comment ]
LITERAL = /^'([^']*)'|^"([^"]*)"/u