public String getSerializedOM(String xmlString) throws Exception {
try {
XMLInputFactory factory = XMLInputFactory.newInstance();
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(xmlString.getBytes());
StAXOMBuilder staxOMBuilder = OMXMLBuilderFactory.
createStAXOMBuilder(OMAbstractFactory.getOMFactory(),
factory.createXMLStreamReader(byteArrayInputStream));
staxOMBuilder.setDoDebug(true);
OMElement rootElement = staxOMBuilder.getDocumentElement();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
OMOutputFormat format = new OMOutputFormat();
format.setIgnoreXMLDeclaration(ignoreXMLDeclaration);