     
     mutating func extractAttributeValue() throws -> Bytes {
         skip(until: .quote)
-        assert(scanner.peek() == .quote)
-        
-        // opening `"`
-        scanner.pop()
+        
+        try expect([.quote])
         skipWhitespace()
         
         let value = consume(until: .quote)
         
-        guard scanner.peek() == .quote else {
-            throw Error.malformedXML("expected closing `\"`")
-        }
-        
-        // closing `"`
-        scanner.pop()
+        try expect([.quote])
+        
         return value
     }
 }
 
 extension XMLParser {
-    mutating func isClosingTag(_ expectedTagName: Bytes) -> Bool {
-        assert(scanner.peek(aheadBy: 1) == .forwardSlash)
-        
-        // </
-        scanner.pop(2)
+    mutating func isClosingTag(_ expectedTagName: Bytes) throws -> Bool {
+        try expect(closingTagHeader)
         
         let tagName = consume(until: tagNameTerminators)
-        skipWhitespace()
-        assert(scanner.peek() == .greaterThan)
-        scanner.pop()
+        
+        skipWhitespace()
+        try expect([.greaterThan])
+        
         return tagName.elementsEqual(expectedTagName)
     }
     
-    mutating func eatComment() {
-        assert(scanner.peek() == .exclamationPoint)
-        
-        //TODO(Brett): be sure this is actually a comment before popping.
-        // otherwise throw an error
-        // !--
-        scanner.pop(3)
+    mutating func eatComment() throws {
+        try expect(commentHeader)
         
         while scanner.peek() != nil {
             skip(until: .hyphen)
             
-            guard scanner.peek(aheadBy: 1) != .hyphen else {
-                // -->
-                scanner.pop(3)
+            guard !find(commentFooter) else {
+                // consume
+                try expect(commentFooter)
                 break
             }
         }

/// <![CDATA[
let cDataHeader: Bytes = [.lessThan, .exclamationPoint, .leftSquareBracket, .C, .D, .A, .T, .A, .leftSquareBracket]

// ]]>
let cDataFooter: Bytes = [.rightSquareBracket, .rightSquareBracket, .greaterThan]

extension Byte {
    /// <

        
        // self-closing tag early-escape
        guard token != .forwardSlash else {
            try expect(selfClosingTagFooter)
            return sighting
        }
        
