On this page:
lists->xml
lists->compact_  xml

3 lists->xml

procedure

(lists->xml xml)  string?

  xml : list?

convert lists to xml, the list should obey below rules.

1. First node of list should be a string? or symbol? It represent node name.

'("H1") -> <H1/>

2. All the pairs represent node’s attributes.

'("H1" ("attr1" . "1") ("attr2" . "2")) -> <H1 "attr1"="1" "attr2"="2"/>

3. If have children, string/symbol represent its value, or, the lists represents its children. Node’s children should either string? or symbol? or lists?, only one of these three types.

'("H1" "haha") -> <H1>haha</H1>
 
'("H1" ("H2" "haha")) ->
 
  <H1>
    <H2>
      haha
    </H2>
  </H1>

procedure

(lists->compact_xml xml)  string?

  xml : list?

remove all the format characters.

'("H1" ("H2" "haha")) -> <H1><H2>haha</H2></H1>