That is not possible directly. Components and other "content" data, like the Page metadata from your example, are saved as raw XML into the Content Manager database. The XMLs don't contain empty nodes for elements without values and because the Core Service just exposes the whole "section" of the XML to you, you won't have the empty nodes there either.
What you could do is to take a look at the SchemaFieldsData
class and its property MetadataFields
, which will give you a list of the schema's meta fields in the form of ItemFieldDefinitionData
. That class in turn has the Name
property which corresponds to xml field name.
You get the SchemaFieldsData
object via the ReadSchemaFields()
method which takes the id of the metadata Schema ( which you can get by using PageData.MetadataSchema.IdRef
)