Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4266900
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T06:49:27+00:00 2026-05-21T06:49:27+00:00

I have an application where in i need to save the data input by

  • 0

I have an application where in i need to save the data input by a user in a form in an XML file at a specified location and i need to perform this using Java . I am relatively very new to XML handling in java. I would like some suggestions as to how to start the task .

Any code snippets and links will be helpful …

Thank You

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T06:49:28+00:00Added an answer on May 21, 2026 at 6:49 am

    There is very good framework JAXB for this also there is Simple

    But I have used this XStream

    Person joe = new Person("Joe", "Walnes");
    joe.setPhone(new PhoneNumber(123, "1234-456"));
    joe.setFax(new PhoneNumber(123, "9999-999"));
    

    Now, to convert it to XML, all you have to do is make a simple call to XStream:

    String xml = xstream.toXML(joe);
    

    The resulting XML looks like this:

    <person>
      <firstname>Joe</firstname>
      <lastname>Walnes</lastname>
      <phone>
        <code>123</code>
        <number>1234-456</number>
      </phone>
      <fax>
        <code>123</code>
        <number>9999-999</number>
      </fax>
    </person>
    

    Also See

    • JAXB
    • where-i-can-find-a-detailed-comparison-of-java-xml-frameworks
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an NSMutableArray with 24 strings. I need to save this data if
I have this application that need to do some things in protected paths (like
I have an application where I need the user to upload a photo. After
I am confused when using resource files. In my application I need to save
I am making an application where I need to save affiliation data One of
I have data analysis application and I need to be able to export database
I have two application that need to talk to each other. App1 needs to
I have an application I need to analyze. I have the source code here.
I have a java application I need to pass some info to a C++
I have an application where I need to populate a textbox with a company

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.