export default function formatXml(xml: string): string { if (typeof xml !== 'string') return ''; xml = xml.replace(/>\s*<'); let formatted = ''; let indent = 0; const tags = xml.split(/(<.*?>)/g).filter(s => s.trim()); for (let tag of tags) { if (tag.startsWith('') && !tag.startsWith('