` etc. We should preserve as is? The instruction: Keep all HTML tags intact. So we should not fix malformed tags; just translate text nodes. However there is a stray `Pope John XII` => Arabic: "البابا يوحنا الثاني عشر" maybe "البابا يوحنا الثاني عشر". Use appropriate translation. - `

Pope John XII can also refer to Pope John XII of Alexandria.

` => Arabic: "يمكن أن يشير البابا يوحنا الثاني عشر أيضًا إلى البابا يوحنا الثاني عشر من الإسكندرية." - `

Pope John XII (Latin: Ioannes XII; c. 930/937 – 14 May 964) was head ...` This is a self-closing `

` then text. The text after the self-closing tag is considered text node outside any tag? Actually `

` is a self-closing paragraph tag (XHTML style). Then the text appears after it, not inside a paragraph. We need to translate that text. So we will keep `

` unchanged, then translate the following text. The text: "Pope John XII (Latin: Ioannes XII; c. 930/937 – 14 May 964) was head of the Catholic Church from 16 December 955 to his death in 964. He was related to the Counts of Tusculum and a member of the powerful Roman family of Theophylact which had dominated papal politics for over half a century. His pontificate became infamous for the alleged depravity and worldliness with which he conducted his office." We need to translate to Arabic. - Next: `

Birth and election as pope

` Actually there is `

Birth and election as pope

` So there is a self-closing `

` then text "Birth and election as pope" then closing `

`. So we need to translate "Birth and election as pope" to Arabic, keep tags. - Next: `

John XII was born Octavianus, the son ...` So similar. - The link text: `Continue Reading` => translate "Continue Reading" to Arabic: "متابعة القراءة" maybe "تابع القراءة". We'll use "متابعة القراءة". - The `


` stays. - `

Source: https://en.wikipedia.org/wiki/Pope_John_XII

` The visible text "Source: " should be translated to Arabic: "المصدر: ". Keep the link unchanged. - The final stray `

` etc we keep as is. Now we need to ensure we preserve all tags exactly as they appear, including self-closing tags with space before slash? The original has `

` (space before slash). We'll keep same. Now produce final HTML. Let's translate each paragraph. First paragraph after `

`: Original English: "Pope John XII (Latin: Ioannes XII; c. 930/937 – 14 May 964) was head of the Catholic Church from 16 December 955 to his death in 964. He was related to the Counts of Tusculum and a member of the powerful Roman family of Theophylact which had dominated papal politics for over half a century. His pontificate became infamous for the alleged depravity and worldliness with which he conducted his office." Arabic translation: "البابا يوحنا الثاني عشر (باللاتينية: Ioannes XII؛ تقريبًا 930/937 – 14 مايو 964) كان رأس الكنيسة الكاثوليكية من 16 ديسمبر 955 حتى وفاته في 964. كان مرتبطًا بكونتات توسكولوم وعضوًا في العائلة الرومانية القوية ثيوفيلكت التي سيطرت على السياسة البابوية لأكثر من نصف قرن. أصبح بابويته مشهورة بالفساد المزعوم والدنيوية التي مارس بها مهامه." Make sure to keep punctuation. Second paragraph: "Birth and election as pope" => "الولادة والانتخاب كبابا" maybe "الولادة والانتخاب كبابا". Could be "الميلاد والانتخاب كبابا". We'll use "الميلاد والانتخاب كبابا". Or "الولادة والانتخاب كبابا". Choose "الولادة والانتخاب كبابا". Third paragraph: "John XII was born Octavianus, the son of Alberic II of Spoleto, Patrician and self-styled prince of Rome. His mother is believed to have been Alda of Vienne, Alberic’s stepsister and the daughter of King Hugh of Italy. However, there is some doubt …" Arabic translation: "ولد يوحنا الثاني عشر باسم أوكتافيانو، ابن ألبرِك الثاني من سبوليتو، الباتريك والزعيم المزعوم لروما. يُعتقد أن والدته كانت ألدا من فيين، أخت زوج ألبرِك وأبنة الملك هوغو من إيطاليا. ومع ذلك، هناك بعض الشك …" Now the link text: "Continue Reading" => "متابعة القراءة". Now the source line: "Source: " => "المصدر: ". Now produce final HTML. Need to keep line breaks? Not required but we can keep. Let's construct final HTML:

البابا يوحنا الثاني عشر

يمكن أن يشير البابا يوحنا الثاني عشر أيضًا إلى البابا يوحنا الثاني عشر من الإسكندرية.

البابا يوحنا الثاني عشر (باللاتينية: Ioannes XII؛ تقريبًا 930/937 – 14 مايو 964) كان رأس الكنيسة الكاثوليكية من 16 ديسمبر 955 حتى وفاته في 964. كان مرتبطًا بكونتات توسكولوم وعضوًا في العائلة الرومانية القوية ثيوفيلكت التي سيطرت على السياسة البابوية لأكثر من نصف قرن. أصبح بابويته مشهورة بالفساد المزعوم والدنيوية التي مارس بها مهامه.

الولادة والانتخاب كبابا

ولد يوحنا الثاني عشر باسم أوكتافيانو، ابن ألبرِك الثاني من سبوليتو، الباتريك والزعيم المزعوم لروما. يُعتقد أن والدته كانت ألدا من فيين، أخت زوج ألبرِك وأبنة الملك هوغو من إيطاليا. ومع ذلك، هناك بعض الشك … متابعة القراءة


المصدر: https://en.wikipedia.org/wiki/Pope_John_XII

`? Let's check original snippet: ```

John XII was born Octavianus, the son of Alberic II of Spoleto, Patrician and self-styled prince of Rome. His mother is believed to have been Alda of Vienne, Alberic’s stepsister and the daughter of King Hugh of Italy. However, there is some doubt … Continue Reading


Source: https://en.wikipedia.org/wiki/Pope_John_XII

` closing the paragraph that started with `

John XII...`. So we need to keep that closing tag. Thus our translation should have same structure: `

` then text then link then `

`. Also there is a `

` after the `


` then `` after the second paragraph? Actually there is `

Birth and election as pope

` So we need to keep that exactly: `

Birth and election as pope

`