positions = ET.SubElement(dataPoints, "positions", axis="2Theta", unit="deg") positions.text = ";".join(f"x:.4f" for x in theta)
If you don't have access to high-end XRD software, you can use general-purpose data tools to map Excel headers to the XRDML schema. How can I convert Excel file to XRDML file? - ResearchGate 29 Nov 2018 — convert excel to xrdml
The most widely recommended tool for this conversion is , a free .NET dynamic link library and standalone utility designed for the interconversion of powder X-ray diffraction file formats. positions = ET
| Problem | Likely Cause | Solution | |---------|--------------|----------| | "Invalid XML" | Missing XML declaration line | Add <?xml version="1.0"?> at top | | "No data points found" | Using commas instead of semicolons in data string | Replace commas with semicolons | | "Axis error" | First column not strictly increasing | Sort rows by 2θ in Excel before conversion | | "Negative intensity" | Background subtraction created negative values | Set negative values to 0 or add offset | | Problem | Likely Cause | Solution |