Time and space complexity for SDA parsing using object deserialization and xml xpath
Intersytems documentation says not to hold entire SDA as object in In-memory.
Set object = ##class(User.NewClass1).%New()
s object.Property1="one"
s object.Property2="two"
s object.Property3="three"
s object.Property4="four"
Set w=##class(%XML.Writer).%New()
set w.Charset="UTF-8"
Set w.Indent=1
set status=w.OutputToString()
set status=w.StartDocument()
Set status=w.RootObject(object,"Vivek")
set status=w.EndDocument()
If $$$ISERR(status) Do $system.OBJ.DisplayError(status) Quit
set xmlstring = w.GetXMLString()
// Serialize XML to Object
Set obj = ##class(User.NewClass1).%New()
Set reader = ##class(%XML.Reader).%New()
Set status =reader.OpenString(xmlstring)
Do reader.CorrelateRoot("User.NewClass1")
Do reader.Next(.obj,.status)
Write "Property1 "_obj.Property1