OMFactory omFac = metaFactory.getOMFactory();
OMElement documentElement = omFac.createOMElement("RootElement", null);
OMNamespace ns1 = documentElement.declareNamespace("http://one.org", "ns1");
OMNamespace ns2 = documentElement.declareNamespace("http://one.org", "ns2");
OMElement childOne = omFac.createOMElement("ChildElementOne", ns2, documentElement);
childOne.declareDefaultNamespace("http://one.org");
OMElement childTwo = omFac.createOMElement("ChildElementTwo", ns1, childOne);