Use a simple identity transformation with indent="yes
specified on the <xsl:output>
declaration:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
This transformation, when applied on the provided XML document (the undefined entity
replaced by its corresponding character entity  
):
<dtd name="cited">
<XMLDOC>
<cited year="2010">
<case>
No. 275 v. M.N.R.
<cite>
<yr>
2010
<pno cite="20101188">10</pno>
</yr>
</cite>
</case>
</cited>
</XMLDOC>
<XMLDOC>
<case>
Wellesley St.
<cite>
<yr>
2010
<pno cite="20105133">9</pno>
</yr>
</cite>
</case>
</XMLDOC>
</dtd>
produces, when run with AltovaXML:
<dtd name="cited">
<XMLDOC>
<cited year="2010">
<case>
No. 275 v. M.N.R.
<cite>
<yr>
2010
<pno cite="20101188">10</pno></yr>
</cite></case>
</cited>
</XMLDOC>
<XMLDOC>
<case>
Wellesley St.
<cite>
<yr>
2010
<pno cite="20105133">9</pno></yr>
</cite></case>
</XMLDOC>
</dtd>
The same transformation, when run with Saxon 6.5.4 produces:
<dtd name="cited">
<XMLDOC>
<cited year="2010">
<case>
No. 275 v. M.N.R.
<cite>
<yr>
2010
<pno cite="20101188">10</pno>
</yr>
</cite>
</case>
</cited>
</XMLDOC>
<XMLDOC>
<case>
Wellesley St.
<cite>
<yr>
2010
<pno cite="20105133">9</pno>
</yr>
</cite>
</case>
</XMLDOC>
</dtd>
So, the output is largely different, depending which XSLT 1.0 processor is used. Saxon parses and does not discard every whitespace-only node and this plus the indentation produces too much white space.
The workaround is to explicitly cause stripping of the whitespace-only nodes using:
<xsl:strip-space elements="*"/>
So, when this transformation:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
is run with Saxon against the same source XML document, the output is now:
<dtd name="cited">
<XMLDOC>
<cited year="2010">
<case>
No. 275 v. M.N.R.
<cite>
<yr>
2010
<pno cite="20101188">10</pno>
</yr>
</cite>
</case>
</cited>
</XMLDOC>
<XMLDOC>
<case>
Wellesley St.
<cite>
<yr>
2010
<pno cite="20105133">9</pno>
</yr>
</cite>
</case>
</XMLDOC>
</dtd>
AltovaXML and a number of other XSLT 1.0 processors (.NET's XslCompiledTransform, XslTransform) also produces nice indented output running the last transformation.
UPDATE:
Just recently in his comments, the OP leaked out important new requirement, which makes this problem completely not just "indentation"...
From comments:
what i want is to apply the correct
closing tags like
<yr></yr>
<pno cite="20101188">10</pno>
instead of
<yr>
2010
<pno cite="20101188">10</pno>
</yr>
Here is the transformation, that produces the wanted output:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="yr">
<yr>
<xsl:apply-templates select="text()[1]"/>
</yr>
<xsl:apply-templates select="*"/>
</xsl:template>
</xsl:stylesheet>