I see a post Convert xml (mixed nodes and attributes) to csv file using c#, the poster has an XML which has mix of nodes and nodes with attributes:
<?xml version="1.0" encoding="utf-8"?>
<Root>
<StudentRequestList count="3">
<StudentRequest>
<StudentFirstName>Test1</StudentFirstName>
<StudentLastName>TestLastName</StudentLastName>
<StudentGrade>3</StudentGrade>
<StudentHomeroomTeacher>WhiteTest1</StudentHomeroomTeacher>
<VariableData>
<Variable name="Email">test@email.com</Variable>
<Variable name="Hobby1">TestHobby1</Variable>
<Variable name="Hobby2">TestHobby2</Variable>
<Variable name="Hobby3">TestHobby3</Variable>
<Variable name="satscore">satscoreTest1</Variable>
<Variable name="kprepscore">krepscore1</Variable>
</VariableData>
</StudentRequest>
<StudentRequest>
<StudentFirstName>Test2</StudentFirstName>
<StudentLastName>TestLastName2</StudentLastName>
<StudentGrade>3</StudentGrade>
<StudentHomeroomTeacher>WhiteTest1</StudentHomeroomTeacher>
<VariableData>
<Variable name="Email">test2@email.com</Variable>
<Variable name="Hobby5">TestHobby5</Variable>
<Variable name="Hobby6">TestHobby6</Variable>
<Variable name="Hobby3">TestHobby3</Variable>
<Variable name="satscore">satscoreTest2</Variable>
<Variable name="kprepscore">krepscore2</Variable>
</VariableData>
</StudentRequest>
<StudentRequest>
<StudentFirstName>Test1</StudentFirstName>
<StudentLastName>TestLastName</StudentLastName>
<StudentGrade>3</StudentGrade>
<StudentHomeroomTeacher>WhiteTest1</StudentHomeroomTeacher>
<VariableData>
<Variable name="Email">test@email.com</Variable>
<Variable name="Hobby4">TestHobby4</Variable>
<Variable name="Hobby2">TestHobby2</Variable>
<Variable name="Hobby3">TestHobby3</Variable>
<Variable name="satscore">satscoreTest3</Variable>
<Variable name="kprepscore">krepscore3</Variable>
</VariableData>
</StudentRequest>
</StudentRequestList>
</Root>
CSV is supposed to look like:
StudentFirstName,StudentLastName,StudentGrade,StudentHomeroomTeacher,Email, Hobby1, Hobby2,Hobby3, Hobby4, Hobby5, Hobby6, satscore, kprepscore Test1,TestLastName,3,WhiteTest1,test@email.com,TestHobby1,TestHobby2,TestHobby3,,,,satscoreTest1,krepscore1 Test2,TestLastName2,3,WhiteTest1,test2@email.com,,,Hobby3,,Hobby5,Hobby6,satscoreTest2,krepscore2 Test1,TestLastName,3,WhiteTest1,test@email.com,,Hobby2,Hobby3,Hobby4,,,satscoreTest3,krepscore3
I think Data File Converter can do this, need to coding, so I tried, yes, it can, in a minute.
1. Open XML file in DataFileConverter, set XML options.
2. Set XML custom columns.
3. Set CSV options.
4. “Next” and “Next”, convert, get output CSV file.