Listing 1

MessageBundle_en_US.properties file:
template = At {2,time,short} on {2,date,long}, we detected \
{1,number,integer} spaceships on the planet {0}.
planet = Mars

MessageBundle_en_US.properties.xlf

<?xml version="1.0"?>
<xliff version='1.1'
xmlns='urn:oasis:names:tc:xliff:document:1.1'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:schemaLocation='urn:oasis:names:tc:xliff:document:1.1
xliff-core-1.1.xsd'>
  <file source-language="en_US" datatype="javapropertyresourcebundle"
   original="MessageBundle_en_US.properties">
    <body>
      <trans-unit id="1" restype="string" resname="template" >
      <source>At <ph id="1">{2,time,short}</ph> on <ph
	   id="2">{2,date,long}</ph>, we detected <ph id="3">{1,number,integer}</ph>
	    spaceships on the planet <ph id="4">{0}</ph>.</source>
      </trans-unit>
      <trans-unit id="1" restype="string" resname="planet" >
        <source>Mars</source>
      </trans-unit>
    </body>
  </file>
</xliff>

Listing 2

<?xml version="1.0" encoding="utf-8"?>
<xliff version="1.1">
<file source-language='en' target-language='fr' datatype="database" original="LR GWS">
<header>
      <count-group>
        <count count-type="word">11</count>
      </count-group>
</header>
<body>
<trans-unit>
        <source xml:lang="en-US">We are testing XLIFF.</source>
        <target xml:lang="en">Nous testons XLIFF.</target>
</trans-unit>
<trans-unit>
        <source xml:lang="en-US">The translation portal.</source>
        <target xml:lang="fr">Le portal de traduction.</target>
</trans-unit>
</body>
</file>
</xliff>

Listing 3

A sample PO file:
#: example.cpp:134 example.cpp:343 example2.cpp:23
msgid untranslated-string
msgstr translated-string

is represented by an XLIFF as follows:
<trans-unit id="##1">
   <source xml:space="preserve">untranslated-string</source>
   <target xml:space="preserve">translated-string</target>
   <context-group name="x-po-reference#1" purpose="location">
      <context context-type="sourcefile">example.cpp</context>
      <context context-type="linenumber">134</context>
   </context-group>
   <context-group name="x-po-reference#2" purpose="location">
      <context context-type="sourcefile">example.cpp</context>
      <context context-type="linenumber">343</context>
   </context-group>
   <context-group name="x-po-reference#3" purpose="location">
      <context context-type="sourcefile">example2.cpp</context>
      <context context-type="linenumber">23</context>
   </context-group>
</trans-unit>

Listing 4

<xliff version='1.1'
 xmlns='urn:oasis:names:tc:xliff:document:1.1'
 xmlns:mysc='http://www.myschema.com/myschema-v1'>
 <file original='mydoc.doc' source-language='en' traget-language='fr'
  datatype='plaintext'>
  <group>
   < mysc:info>
    	<mysc:details>details go here</ mysc: details >
   </ mysc:info>
   <trans-unit id='1'>
    <source xml:lang='en'>Text to be translated </source>
    <target state="needs-review-translation" xml:lang='fr'>translated text</target>
   </trans-unit>
  </group>
  </file>
</xliff>

Listing 5

<p>
<b>The Car company</b> <b>centres</b> offer you the chance to drive a A-type,
 B-type, C-type or D-type on every kind of off-road surface so you don't need to currently
  own one to get to grips with an amazing weekend's off-roading.
  </p>

<p>Couple this with great accommodation and you'll end up having a
fantastic time in some beautiful locations.</p>


<p><b>For more information contact:</b>
<br></p>

Listing 6

<trans-unit id="11" datatype="adLongVarWChar" translate="yes">
<source>
<g id="1" ctype="p">
<g id="2" ctype="b">The Car company</g>
<g id="3" ctype="b">centres</g>
offer you the chance to drive a A-type, B-type, C-type or D-type on every kind of off-road
 surface so you don't need to currently own one to get to grips with an amazing weekend's
  off-roading.
</g>
<g id="4" ctype="p">Couple this with great accommodation and you'll end up having a
 fantastic time in some beautiful locations.</g>
<g id="5" ctype="p">
   <g id="6" ctype="b">For more information contact:</g>
   <g id="7" ctype="br"/>
</g>
<g id="8" ctype="p">Please add image and copy for Driving Centres (if applicable)
</g>
</source>
</trans-unit>