# NOT RUN {
txt = paste0("<doc><part><name>ABC</name><type>XYZ</type>",
"<cost>3.54</cost><status>available</status></part></doc>")
doc = xmlParse(txt)
code = makeClassTemplate(xmlRoot(doc)[[1]], types = c(cost = "numeric"))
as(xmlRoot(doc)[["part"]], "part")
# }
Run the code above in your browser using DataLab