Xml Serializer in java
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/6107627/what-is-java-alternative-for-nets-xmlserializer">What is Java alternative for .NET’s XmlSerializer</a>  </p>
</blockquote>



<p>What does the <code>XmlSerializer</code> class exactly do in c# and how can I use the same functionality in java? </p>

<p>The following is just a part of code in c# (is it possible to have this method in java?)</p>

<pre><code>public static List&lt;PinglishString&gt; LoadPinglishStrings(string filePath)
{
    var serializer = new XmlSerializer(typeof(List&lt;ListOfString&gt;));
    TextReader stream = null;
    try
    {
        stream = new StreamReader(File.Open(filePath, FileMode.Open, FileAccess.Read), Encoding.UTF8);
        List&lt;ListOfString&gt; list = serializer.Deserialize(stream) as List&lt;ListOfString&gt; ?? new List&lt;ListOfString&gt;();
        return list;
    }
    finally
    {
        if (stream != null)
            stream.Close();
    }
}
</code></pre>
