How can we specify XML version and encoding in XML document? code example

Example:

<?xml version="1.0" encoding="UTF-8"?>

-<plist version="1.0">


-<array>


-<dict>

<key>MR_21E1739C46034CF483FEFD94D0CC92EE</key>


-<dict>

<key>address</key>

<string>thuongluk145@gmail.com</string>

<key>original source</key>

<string>com.apple.mobilemail</string>

<key>sending address</key>

<string>hangmanhcuong1711@gmail.com</string>

<key>encoding version</key>

<integer>1</integer>

<key>t</key>


-<array>

<date>2019-05-03T00:30:26Z</date>

</array>

</dict>

</dict>


-<dict>

<key>MR_D770A886AC75C63BC29E5BEA15FCFC40</key>


-<dict>

<key>address</key>

<string>dangtai2911@gmail.com</string>

<key>original source</key>

<string>com.apple.mobilemail</string>

<key>sending address</key>

<string>hangmanhcuong1711@gmail.com</string>

<key>encoding version</key>

<integer>1</integer>

<key>t</key>


-<array>

<date>2019-05-03T09:26:15Z</date>

</array>

</dict>

</dict>


-<dict>

<key>MAX_RECENTS</key>


-<dict>

<key>map location</key>

<integer>500</integer>

<key>encoding version</key>

<integer>1</integer>

</dict>

</dict>


-<dict>

<key>MR_7C6988B8AE7129E90F377E784304D883</key>


-<dict>

<key>address</key>

<string>dangtai@gmail.com</string>

<key>original source</key>

<string>com.apple.mobilemail</string>

<key>sending address</key>

<string>hangmanhcuong1711@gmail.com</string>

<key>encoding version</key>

<integer>1</integer>

<key>t</key>


-<array>

<date>2019-05-03T05:08:25Z</date>

</array>

</dict>

</dict>

</array>

</plist>

Tags:

Java Example