Why use XML to Elm instead of JSON to Elm?
Choose XML to Elm when the source payload is XML and you want Elm-specific type aliases that reflect nested elements and repeated nodes instead of JSON object conventions.
Generate Elm type aliases from XML samples when your frontend still consumes XML-backed APIs and wants decoder-friendly state models.
<user>
<id>101</id>
<name>Ada Lovelace</name>
<active>true</active>
<roles>
<role>admin</role>
<role>editor</role>
</roles>
<profile>
<email>ada@example.com</email>
<score>9.8</score>
</profile>
</user>
type alias UserModel =
{
id : Int
, name : String
, active : Bool
, roles : List String
}
Choose XML to Elm when the source payload is XML and you want Elm-specific type aliases that reflect nested elements and repeated nodes instead of JSON object conventions.
Yes. Nested XML elements become additional Elm type aliases, and repeated nodes are inferred into `List` fields based on the parsed XML sample.