My goal is to take an XML string and parse it with XMLBeans XmlObject and add some child nodes.
Here's a sample document (xmlString),
<?xml version="1.0"?>
<rootNode>
<person>
<emailAddress>joefoo@example.com</emailAddress>
</person>
</rootNode>
This is how I would like the XML document to be after adding some nodes,
<?xml version="1.0"?>
<rootNode>
<person>
<emailAddress>joefoo@example.com</emailAddress>
<phoneNumbers>
<home>555-555-5555</home>
<work>555-555-5555</work>
<phoneNumbers>
</person>
</rootNode>
Basically, just add a <phoneNumbers/>node with two child nodes <home/>and <work/>.
This, as I understand it,
XmlObject xml = XmlObject.Factory.parse(xmlString);
thank
wsams source
share