Apache Axiom - Convert xml string to OMElement

Tuesday of September 04, 2012

Recently I have been working with Apache Axiom and needed to conduct a unit test to verify my module. I needed to immediately feed xml data and convert it to an OMElement, below is a way to perform such conversion.

OMElement omElemHeader = AXIOMUtil.stringToOM("<xml><header>my header text</header></xml>");