Just to follow up, Wolfram does handle the ill-formed XML.
Using the test data above,
Cases[xml, XMLElement["input", l___] :> l, Infinity]
Returns:
{{"type" -> "radio", "id" -> "field_1", "name" -> "choices",
"value" -> "1"}, {}, {"type" -> "radio", "id" -> "field_2",
"name" -> "choices", "value" -> "2"}, {}, {"type" -> "radio",
"id" -> "field_3", "name" -> "choices",
"value" -> "3"}, {}, {"type" -> "radio", "id" -> "field_4",
"name" -> "choices", "value" -> "4"}, {}, {"type" -> "radio",
"id" -> "field_5", "name" -> "choices",
"value" -> "5"}, {}, {"type" -> "radio", "id" -> "field_6",
"name" -> "choices", "value" -> "6"}, {}}
However, we are still case sensitive, but HTML is not case sensitive. StringCases allows us to use the IgnoreCase option. Can we tell Cases and XMLElement to ignore case?
Thanks.