XML to Java Class Generator

Generate Java POJO classes from sample XML with Jakarta JAXB or Jackson XML annotations, automatic List<T> inference, and Lombok @Data or explicit getters/setters.

Private by architecture: All processing is 100% client-side memory. Your data never leaves this browser tab.
Sample XML input
0 lines · 0 charsXML
Generated Java classes
0 lines · 0 chars

About This Tool

Infers strongly typed Java POJO classes directly from a sample XML document -- detecting attributes, scalar text values, nested child elements, and repeated sibling tags.

Choose between Jakarta JAXB annotations (@XmlRootElement, @XmlAttribute, @XmlElement, @XmlValue), Jackson XML (@JacksonXmlProperty, @JacksonXmlElementWrapper), or plain unannotated POJOs with Lombok @Data or explicit getters and setters.

Key Features

  • JAXB, Jackson XML & Plain POJO modes: Switch between Jakarta XML Binding (jakarta.xml.bind), Jackson XML (jackson-dataformat-xml), or clean POJOs.
  • Automatic type & List<T> inference: Infers Integer, Long, Double, Boolean, and String types and converts repeated XML sibling tags into List<T> fields.
  • Nested static or separate classes: Emit child element classes as public static inner classes or top-level package-private classes.
  • Lombok @Data or explicit accessors: Toggle between concise Lombok @Data annotations or full getter and setter methods.

Frequently Asked Questions

How does the generator handle an XML element that has both attributes and a text body?
When an element carries XML attributes alongside a scalar text body (such as <item sku="A1">19.99</item>), the generator creates a dedicated class with @XmlAttribute fields for the attributes and an @XmlValue (or @JacksonXmlText) field for the text content.
Which JAXB package does this tool import?
It generates modern jakarta.xml.bind.annotation.* imports used by Spring Boot 3+, Jakarta EE 9+, and Java 17/21 projects.
How are repeated sibling elements mapped in Jackson XML mode?
Repeated sibling tags without an outer wrapper element receive @JacksonXmlElementWrapper(useWrapping = false) alongside @JacksonXmlProperty so Jackson deserializes them directly into a List<T>.
Is my XML document uploaded to a server?
No. XML parsing and Java code generation execute locally in your browser.