まともに使えるHTMLパーサが見つかりません(涙…ってことで自前で書いてみた→タグの小文字化

function HTMLLower(const Source: string): string;
var
 P: PChar; S: (inText, inTag, inStrS, inStrD, inRem, inDocType);
begin
 Result := Source; P := PChar(Result); S := inText;
 while P^ <> #0 do begin
  case S of
  inText: if StrLComp(P, '<!--', 4) = 0 then S := inRem
   else if StrLComp(P, '<!', 2) = 0 then S := inDocType
   else if P^ = '<' then S := inTag;
  inTag: case P^ of
   '>' : S := inText;
   '''': S := inStrS;
   '"' : S := inStrD;
   'A'..'Z': P^ := Chr(Ord(P^) + (Ord('a') - Ord('A')));
   end;
  inStrS: if P^ = '''' then S := inTag;
  inStrD: if P^ = '"' then S := inTag;
  inRem: if StrLComp(P, '-->', 3) = 0 then S := inText;
  inDocType: if P^ = '>' then S := inText;
  end;
  if P^ in LeadBytes then Inc(P); Inc(P)
 end
end;

以後放置。教えてもらったXMLパーサで遊びます♪